Merge remote-tracking branch 'upstream/develop' into zapieruser

This commit is contained in:
Frédéric FRANCE 2020-10-31 16:10:16 +01:00
commit be4a4cb54b
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
1184 changed files with 82007 additions and 81393 deletions

View File

@ -17,8 +17,10 @@ filter:
- build/* - build/*
- dev/* - dev/*
- doc/* - doc/*
- test/* - documents/*
- htdocs/includes/* - htdocs/includes/*
- node_modules/*
- test/*
paths: paths:
- htdocs/* - htdocs/*
- scripts/* - scripts/*

View File

@ -15,6 +15,7 @@ NEW: Accountancy - Add options to disable binding on sales, purchases & expense
NEW: Accountancy balance - Add a input to show subtotal by group NEW: Accountancy balance - Add a input to show subtotal by group
NEW: Accountancy - Move to real ledger, real journals, menu disposition NEW: Accountancy - Move to real ledger, real journals, menu disposition
NEW: Accountancy - On transfers, select the periodicity by default NEW: Accountancy - On transfers, select the periodicity by default
NEW: New currency rate editor.
NEW: Add 2 rules for emailcollector: Message send/not sent from Dolibarr NEW: Add 2 rules for emailcollector: Message send/not sent from Dolibarr
NEW: Add a counter of number of words of pages in website module NEW: Add a counter of number of words of pages in website module
NEW: add alert before change thirdparty in takepos NEW: add alert before change thirdparty in takepos

View File

@ -138,7 +138,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook)) if (empty($reshook))
{ {
include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
{ {
@ -172,55 +172,55 @@ if (empty($reshook))
if (!empty($search_date_start)) { if (!empty($search_date_start)) {
$filter['t.doc_date>='] = $search_date_start; $filter['t.doc_date>='] = $search_date_start;
$param .= '&search_date_startmonth=' . GETPOST('search_date_startmonth', 'int') . '&search_date_startday=' . GETPOST('search_date_startday', 'int') . '&search_date_startyear=' . GETPOST('search_date_startyear', 'int'); $param .= '&search_date_startmonth='.GETPOST('search_date_startmonth', 'int').'&search_date_startday='.GETPOST('search_date_startday', 'int').'&search_date_startyear='.GETPOST('search_date_startyear', 'int');
} }
if (!empty($search_date_end)) { if (!empty($search_date_end)) {
$filter['t.doc_date<='] = $search_date_end; $filter['t.doc_date<='] = $search_date_end;
$param .= '&search_date_endmonth=' . GETPOST('search_date_endmonth', 'int') . '&search_date_endday=' . GETPOST('search_date_endday', 'int') . '&search_date_endyear=' . GETPOST('search_date_endyear', 'int'); $param .= '&search_date_endmonth='.GETPOST('search_date_endmonth', 'int').'&search_date_endday='.GETPOST('search_date_endday', 'int').'&search_date_endyear='.GETPOST('search_date_endyear', 'int');
} }
if (!empty($search_doc_date)) { if (!empty($search_doc_date)) {
$filter['t.doc_date'] = $search_doc_date; $filter['t.doc_date'] = $search_doc_date;
$param .= '&doc_datemonth=' . GETPOST('doc_datemonth', 'int') . '&doc_dateday=' . GETPOST('doc_dateday', 'int') . '&doc_dateyear=' . GETPOST('doc_dateyear', 'int'); $param .= '&doc_datemonth='.GETPOST('doc_datemonth', 'int').'&doc_dateday='.GETPOST('doc_dateday', 'int').'&doc_dateyear='.GETPOST('doc_dateyear', 'int');
} }
if (!empty($search_accountancy_code_start)) { if (!empty($search_accountancy_code_start)) {
$filter['t.numero_compte>='] = $search_accountancy_code_start; $filter['t.numero_compte>='] = $search_accountancy_code_start;
$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start); $param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start);
} }
if (!empty($search_accountancy_code_end)) { if (!empty($search_accountancy_code_end)) {
$filter['t.numero_compte<='] = $search_accountancy_code_end; $filter['t.numero_compte<='] = $search_accountancy_code_end;
$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end); $param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end);
} }
if (!empty($search_label_account)) { if (!empty($search_label_account)) {
$filter['t.label_compte'] = $search_label_account; $filter['t.label_compte'] = $search_label_account;
$param .= '&search_label_compte=' . urlencode($search_label_account); $param .= '&search_label_compte='.urlencode($search_label_account);
} }
if (!empty($search_mvt_num)) { if (!empty($search_mvt_num)) {
$filter['t.piece_num'] = $search_mvt_num; $filter['t.piece_num'] = $search_mvt_num;
$param .= '&search_mvt_num=' . urlencode($search_mvt_num); $param .= '&search_mvt_num='.urlencode($search_mvt_num);
} }
if (!empty($search_doc_ref)) { if (!empty($search_doc_ref)) {
$filter['t.doc_ref'] = $search_doc_ref; $filter['t.doc_ref'] = $search_doc_ref;
$param .= '&search_doc_ref=' . urlencode($search_doc_ref); $param .= '&search_doc_ref='.urlencode($search_doc_ref);
} }
if (!empty($search_label_operation)) { if (!empty($search_label_operation)) {
$filter['t.label_operation'] = $search_label_operation; $filter['t.label_operation'] = $search_label_operation;
$param .= '&search_label_operation=' . urlencode($search_label_operation); $param .= '&search_label_operation='.urlencode($search_label_operation);
} }
if (!empty($search_direction)) { if (!empty($search_direction)) {
$filter['t.sens'] = $search_direction; $filter['t.sens'] = $search_direction;
$param .= '&search_direction=' . urlencode($search_direction); $param .= '&search_direction='.urlencode($search_direction);
} }
if (!empty($search_ledger_code)) { if (!empty($search_ledger_code)) {
$filter['t.code_journal'] = $search_ledger_code; $filter['t.code_journal'] = $search_ledger_code;
$param .= '&search_ledger_code=' . urlencode($search_ledger_code); $param .= '&search_ledger_code='.urlencode($search_ledger_code);
} }
if (!empty($search_debit)) { if (!empty($search_debit)) {
$filter['t.debit'] = $search_debit; $filter['t.debit'] = $search_debit;
$param .= '&search_debit=' . urlencode($search_debit); $param .= '&search_debit='.urlencode($search_debit);
} }
if (!empty($search_credit)) { if (!empty($search_credit)) {
$filter['t.credit'] = $search_credit; $filter['t.credit'] = $search_credit;
$param .= '&search_credit=' . urlencode($search_credit); $param .= '&search_credit='.urlencode($search_credit);
} }
if (!empty($search_lettering_code)) { if (!empty($search_lettering_code)) {
$filter['t.lettering_code'] = $search_lettering_code; $filter['t.lettering_code'] = $search_lettering_code;
@ -426,7 +426,7 @@ print '<tr class="liste_titre_filter">';
// Code journal // Code journal
if (!empty($arrayfields['t.code_journal']['checked'])) { if (!empty($arrayfields['t.code_journal']['checked'])) {
print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="' . dol_escape_htmltag($search_ledger_code) . '"></td>'; print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="'.dol_escape_htmltag($search_ledger_code).'"></td>';
} }
// Date document // Date document
if (!empty($arrayfields['t.doc_date']['checked'])) { if (!empty($arrayfields['t.doc_date']['checked'])) {
@ -446,19 +446,19 @@ if (!empty($arrayfields['t.piece_num']['checked']))
} }
// Ref document // Ref document
if (!empty($arrayfields['t.doc_ref']['checked'])) { if (!empty($arrayfields['t.doc_ref']['checked'])) {
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="' . dol_escape_htmltag($search_doc_ref) . '"/></td>'; print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="'.dol_escape_htmltag($search_doc_ref).'"/></td>';
} }
// Label operation // Label operation
if (!empty($arrayfields['t.label_operation']['checked'])) { if (!empty($arrayfields['t.label_operation']['checked'])) {
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="' . dol_escape_htmltag($search_label_operation) . '"/></td>'; print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="'.dol_escape_htmltag($search_label_operation).'"/></td>';
} }
// Debit // Debit
if (!empty($arrayfields['t.debit']['checked'])) { if (!empty($arrayfields['t.debit']['checked'])) {
print '<td class="liste_titre right"><input type="text" class="flat" name="search_debit" size="4" value="' . dol_escape_htmltag($search_debit) . '"></td>'; print '<td class="liste_titre right"><input type="text" class="flat" name="search_debit" size="4" value="'.dol_escape_htmltag($search_debit).'"></td>';
} }
// Credit // Credit
if (!empty($arrayfields['t.credit']['checked'])) { if (!empty($arrayfields['t.credit']['checked'])) {
print '<td class="liste_titre right"><input type="text" class="flat" name="search_credit" size="4" value="' . dol_escape_htmltag($search_credit) . '"></td>'; print '<td class="liste_titre right"><input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).'"></td>';
} }
// Lettering code // Lettering code
if (!empty($arrayfields['t.lettering_code']['checked'])) if (!empty($arrayfields['t.lettering_code']['checked']))
@ -534,7 +534,7 @@ while ($i < min($num, $limit))
$balance = $sous_total_debit - $sous_total_credit; $balance = $sous_total_debit - $sous_total_credit;
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("Balance").':</td>'; print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("Balance").':</td>';
if ($balance > 0 ) if ($balance > 0)
{ {
print '<td class="nowraponall right">'; print '<td class="nowraponall right">';
print price($sous_total_debit - $sous_total_credit); print price($sous_total_debit - $sous_total_credit);
@ -665,7 +665,7 @@ while ($i < min($num, $limit))
if (!empty($arrayfields['t.label_operation']['checked'])) { if (!empty($arrayfields['t.label_operation']['checked'])) {
// Affiche un lien vers la facture client/fournisseur // Affiche un lien vers la facture client/fournisseur
$doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref); $doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref);
print strlen(length_accounta($line->subledger_account)) == 0 ? '<td>' . $line->label_operation . '</td>' : '<td>' . $line->label_operation . '<br><span style="font-size:0.8em">(' . length_accounta($line->subledger_account) . ')</span></td>'; print strlen(length_accounta($line->subledger_account)) == 0 ? '<td>'.$line->label_operation.'</td>' : '<td>'.$line->label_operation.'<br><span style="font-size:0.8em">('.length_accounta($line->subledger_account).')</span></td>';
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
} }
@ -680,7 +680,7 @@ while ($i < min($num, $limit))
// Amount credit // Amount credit
if (!empty($arrayfields['t.credit']['checked'])) { if (!empty($arrayfields['t.credit']['checked'])) {
print '<td class="nowrap right">' . ($line->credit ? price($line->credit) : '') . '</td>'; print '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>';
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalcredit'; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalcredit';
$totalarray['val']['totalcredit'] += $line->credit; $totalarray['val']['totalcredit'] += $line->credit;
@ -733,7 +733,7 @@ print '</tr>';
$balance = $sous_total_debit - $sous_total_credit; $balance = $sous_total_debit - $sous_total_credit;
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("Balance").':</td>'; print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("Balance").':</td>';
if ($balance > 0 ) if ($balance > 0)
{ {
print '<td class="nowraponall right">'; print '<td class="nowraponall right">';
print price($sous_total_debit - $sous_total_credit); print price($sous_total_debit - $sous_total_credit);

View File

@ -400,9 +400,9 @@ $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('AccountAccounting').': '; $moreforfilter .= $langs->trans('AccountAccounting').': ';
$moreforfilter .= '<div class="nowrap inline-block">'; $moreforfilter .= '<div class="nowrap inline-block">';
$moreforfilter .= $langs->trans('From').' '; $moreforfilter .= $langs->trans('From').' ';
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, 'maxwidth200'); $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', 1, 'maxwidth200');
$moreforfilter .= ' '.$langs->trans('to').' '; $moreforfilter .= ' '.$langs->trans('to').' ';
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200'); $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', 1, 'maxwidth200');
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';

View File

@ -822,25 +822,25 @@ class AccountancyExport
print $line->piece_num.$separator; print $line->piece_num.$separator;
// FEC:EcritureDate // FEC:EcritureDate
print $date_document . $separator; print $date_document.$separator;
// FEC:CompteNum // FEC:CompteNum
print $line->numero_compte.$separator; print $line->numero_compte.$separator;
// FEC:CompteLib // FEC:CompteLib
print dol_string_unaccent($line->label_compte) . $separator; print dol_string_unaccent($line->label_compte).$separator;
// FEC:CompAuxNum // FEC:CompAuxNum
print $line->subledger_account.$separator; print $line->subledger_account.$separator;
// FEC:CompAuxLib // FEC:CompAuxLib
print dol_string_unaccent($line->subledger_label) . $separator; print dol_string_unaccent($line->subledger_label).$separator;
// FEC:PieceRef // FEC:PieceRef
print $line->doc_ref.$separator; print $line->doc_ref.$separator;
// FEC:PieceDate // FEC:PieceDate
print dol_string_unaccent($date_creation) . $separator; print dol_string_unaccent($date_creation).$separator;
// FEC:EcritureLib // FEC:EcritureLib
print $line->label_operation.$separator; print $line->label_operation.$separator;
@ -858,7 +858,7 @@ class AccountancyExport
print $line->date_lettering.$separator; print $line->date_lettering.$separator;
// FEC:ValidDate // FEC:ValidDate
print $date_validation . $separator; print $date_validation.$separator;
// FEC:Montantdevise // FEC:Montantdevise
print $line->multicurrency_amount.$separator; print $line->multicurrency_amount.$separator;

View File

@ -707,7 +707,7 @@ class AdherentType extends CommonObject
*/ */
public function initAsSpecimen() public function initAsSpecimen()
{ {
global $conf, $user, $langs; global $user;
// Initialise parametres // Initialise parametres
$this->id = 0; $this->id = 0;
@ -735,46 +735,10 @@ class AdherentType extends CommonObject
*/ */
public function getMailOnValid() public function getMailOnValid()
{ {
global $conf;
if (!empty($this->mail_valid) && trim(dol_htmlentitiesbr_decode($this->mail_valid))) { if (!empty($this->mail_valid) && trim(dol_htmlentitiesbr_decode($this->mail_valid))) {
return $this->mail_valid; return $this->mail_valid;
} }
return ''; return '';
} }
/**
* getMailOnSubscription
*
* @return string Return mail content of type or empty
*/
public function getMailOnSubscription()
{
global $conf;
// mail_subscription not defined so never used
if (!empty($this->mail_subscription) && trim(dol_htmlentitiesbr_decode($this->mail_subscription))) { // Property not yet defined
return $this->mail_subscription;
}
return '';
}
/**
* getMailOnResiliate
*
* @return string Return mail model content of type or empty
*/
public function getMailOnResiliate()
{
global $conf;
// NOTE mail_resiliate not defined so never used
if (!empty($this->mail_resiliate) && trim(dol_htmlentitiesbr_decode($this->mail_resiliate))) { // Property not yet defined
return $this->mail_resiliate;
}
return '';
}
} }

View File

@ -98,17 +98,17 @@ class Members extends DolibarrApi
*/ */
public function getByThirdparty($thirdparty) public function getByThirdparty($thirdparty)
{ {
if (! DolibarrApiAccess::$user->rights->adherent->lire) { if (!DolibarrApiAccess::$user->rights->adherent->lire) {
throw new RestException(401); throw new RestException(401);
} }
$member = new Adherent($this->db); $member = new Adherent($this->db);
$result = $member->fetch('', '', $thirdparty); $result = $member->fetch('', '', $thirdparty);
if ( ! $result ) { if (!$result) {
throw new RestException(404, 'member not found'); throw new RestException(404, 'member not found');
} }
if ( ! DolibarrApi::_checkAccessToResource('adherent', $member->id)) { if (!DolibarrApi::_checkAccessToResource('adherent', $member->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
@ -131,23 +131,23 @@ class Members extends DolibarrApi
*/ */
public function getByThirdpartyEmail($email) public function getByThirdpartyEmail($email)
{ {
if (! DolibarrApiAccess::$user->rights->adherent->lire) { if (!DolibarrApiAccess::$user->rights->adherent->lire) {
throw new RestException(401); throw new RestException(401);
} }
$thirdparty = new Societe($this->db); $thirdparty = new Societe($this->db);
$result = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $email); $result = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $email);
if ( ! $result ) { if (!$result) {
throw new RestException(404, 'thirdparty not found'); throw new RestException(404, 'thirdparty not found');
} }
$member = new Adherent($this->db); $member = new Adherent($this->db);
$result = $member->fetch('', '', $thirdparty->id); $result = $member->fetch('', '', $thirdparty->id);
if ( ! $result ) { if (!$result) {
throw new RestException(404, 'member not found'); throw new RestException(404, 'member not found');
} }
if ( ! DolibarrApi::_checkAccessToResource('adherent', $member->id)) { if (!DolibarrApi::_checkAccessToResource('adherent', $member->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
@ -170,23 +170,23 @@ class Members extends DolibarrApi
*/ */
public function getByThirdpartyBarcode($barcode) public function getByThirdpartyBarcode($barcode)
{ {
if (! DolibarrApiAccess::$user->rights->adherent->lire) { if (!DolibarrApiAccess::$user->rights->adherent->lire) {
throw new RestException(401); throw new RestException(401);
} }
$thirdparty = new Societe($this->db); $thirdparty = new Societe($this->db);
$result = $thirdparty->fetch('', '', '', $barcode); $result = $thirdparty->fetch('', '', '', $barcode);
if ( ! $result ) { if (!$result) {
throw new RestException(404, 'thirdparty not found'); throw new RestException(404, 'thirdparty not found');
} }
$member = new Adherent($this->db); $member = new Adherent($this->db);
$result = $member->fetch('', '', $thirdparty->id); $result = $member->fetch('', '', $thirdparty->id);
if ( ! $result ) { if (!$result) {
throw new RestException(404, 'member not found'); throw new RestException(404, 'member not found');
} }
if ( ! DolibarrApi::_checkAccessToResource('adherent', $member->id)) { if (!DolibarrApi::_checkAccessToResource('adherent', $member->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }

View File

@ -560,7 +560,7 @@ if (!empty($arrayfields['d.email']['checked'])) {
// End of subscription date // End of subscription date
if (!empty($arrayfields['d.datefin']['checked'])) { if (!empty($arrayfields['d.datefin']['checked'])) {
print '<td class="liste_titre left">'; print '<td class="liste_titre left">';
$selectarray=array('-1'=>'', 'withoutsubscription'=>$langs->trans("WithoutSubscription"), 'uptodate'=>$langs->trans("UpToDate"), 'outofdate'=>$langs->trans("OutOfDate")); $selectarray = array('-1'=>'', 'withoutsubscription'=>$langs->trans("WithoutSubscription"), 'uptodate'=>$langs->trans("UpToDate"), 'outofdate'=>$langs->trans("OutOfDate"));
print $form->selectarray('search_filter', $selectarray, $search_filter); print $form->selectarray('search_filter', $selectarray, $search_filter);
print '</td>'; print '</td>';
} }

View File

@ -66,7 +66,7 @@ $v->setPhoneNumber($adherent->phone_pro, "TYPE=WORK;VOICE");
$v->setPhoneNumber($adherent->phone_mobile, "TYPE=CELL;VOICE"); $v->setPhoneNumber($adherent->phone_mobile, "TYPE=CELL;VOICE");
$v->setPhoneNumber($adherent->fax, "TYPE=WORK;FAX"); $v->setPhoneNumber($adherent->fax, "TYPE=WORK;FAX");
$country = $adherent->country_code ? $adherent->country : '' ; $country = $adherent->country_code ? $adherent->country : '';
$v->setAddress("", "", $adherent->address, $adherent->town, $adherent->state, $adherent->zip, $country, "TYPE=WORK;POSTAL"); $v->setAddress("", "", $adherent->address, $adherent->town, $adherent->state, $adherent->zip, $country, "TYPE=WORK;POSTAL");
$v->setLabel("", "", $adherent->address, $adherent->town, $adherent->state, $adherent->zip, $country, "TYPE=WORK"); $v->setLabel("", "", $adherent->address, $adherent->town, $adherent->state, $adherent->zip, $country, "TYPE=WORK");
@ -79,9 +79,9 @@ $v->setTitle($adherent->poste);
if ($company->id) if ($company->id)
{ {
$v->setURL($company->url, "TYPE=WORK"); $v->setURL($company->url, "TYPE=WORK");
if (! $adherent->phone_pro) $v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE"); if (!$adherent->phone_pro) $v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE");
if (! $adherent->fax) $v->setPhoneNumber($company->fax, "TYPE=WORK;FAX"); if (!$adherent->fax) $v->setPhoneNumber($company->fax, "TYPE=WORK;FAX");
if (! $adherent->zip) $v->setAddress("", "", $company->address, $company->town, $company->state, $company->zip, $company->country, "TYPE=WORK;POSTAL"); if (!$adherent->zip) $v->setAddress("", "", $company->address, $company->town, $company->state, $company->zip, $company->country, "TYPE=WORK;POSTAL");
// when company e-mail is empty, use only adherent e-mail // when company e-mail is empty, use only adherent e-mail
if (empty(trim($company->email))) if (empty(trim($company->email)))

View File

@ -163,7 +163,7 @@ $urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentit
$message .= img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'vcal', $urlvcal); $message .= img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'vcal', $urlvcal);
$message .= '<br>'; $message .= '<br>';
$urlical = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">'; $urlical = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
$urlical .=$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>'; $urlical .= $urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$message .= img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', $urlical); $message .= img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', $urlical);
$message .= '<br>'; $message .= '<br>';
$urlrss = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">'; $urlrss = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';

View File

@ -33,7 +33,7 @@ if (!$user->admin) accessforbidden();
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
if (! in_array('clicktodial', $conf->modules)) { if (!in_array('clicktodial', $conf->modules)) {
accessforbidden($langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module58Name"))); accessforbidden($langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module58Name")));
} }

View File

@ -476,7 +476,7 @@ print '</td></tr>'."\n";
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("HideClosedServiceByDefault").'</td>'; print '<td>'.$langs->trans("HideClosedServiceByDefault").'</td>';
print '<td width="60" class="right">'; print '<td width="60" class="right">';
print $form->selectyesno("activate_hideClosedServiceByDefault", (! empty($conf->global->CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT)?$conf->global->CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT:0), 1); print $form->selectyesno("activate_hideClosedServiceByDefault", (!empty($conf->global->CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT) ? $conf->global->CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT : 0), 1);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -47,7 +47,7 @@ if ($action == 'set')
$gimcdf = GETPOST("GEOIPMAXMIND_COUNTRY_DATAFILE"); $gimcdf = GETPOST("GEOIPMAXMIND_COUNTRY_DATAFILE");
if (!$error && $gimcdf && ! preg_match('/\.(dat|mmdb)$/', $gimcdf)) { if (!$error && $gimcdf && !preg_match('/\.(dat|mmdb)$/', $gimcdf)) {
setEventMessages($langs->trans("ErrorFileMustHaveFormat", '.dat|.mmdb'), null, 'errors'); setEventMessages($langs->trans("ErrorFileMustHaveFormat", '.dat|.mmdb'), null, 'errors');
$error++; $error++;
} }

View File

@ -122,7 +122,7 @@ if ($action == 'update')
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLE', $conf->entity); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLE', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val, 'chaine', 0, '', $conf->entity); else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val, 'chaine', 0, '', $conf->entity);
$val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLELINK'), array())))); $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLELINK'), array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLELINK', $conf->entity); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLELINK', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLELINK', $val, 'chaine', 0, '', $conf->entity); else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLELINK', $val, 'chaine', 0, '', $conf->entity);

View File

@ -67,18 +67,18 @@ complete_substitutions_array($substitutionarrayfortest, $langs);
if ($action == 'update' && !$cancel) if ($action == 'update' && !$cancel)
{ {
if (! $error && ! GETPOST("MAIN_MAIL_EMAIL_FROM", 'alphanohtml')) { if (!$error && !GETPOST("MAIN_MAIL_EMAIL_FROM", 'alphanohtml')) {
$error++; $error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("MAIN_MAIL_EMAIL_FROM")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("MAIN_MAIL_EMAIL_FROM")), null, 'errors');
$action = 'edit'; $action = 'edit';
} }
if (! $error && ! isValidEmail(GETPOST("MAIN_MAIL_EMAIL_FROM", 'alphanohtml'))) { if (!$error && !isValidEmail(GETPOST("MAIN_MAIL_EMAIL_FROM", 'alphanohtml'))) {
$error++; $error++;
setEventMessages($langs->trans("ErrorBadEMail", GETPOST("MAIN_MAIL_EMAIL_FROM", 'alphanohtml')), null, 'errors'); setEventMessages($langs->trans("ErrorBadEMail", GETPOST("MAIN_MAIL_EMAIL_FROM", 'alphanohtml')), null, 'errors');
$action = 'edit'; $action = 'edit';
} }
if (! $error) { if (!$error) {
dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS", 'int'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_FORCE_SENDTO", GETPOST("MAIN_MAIL_FORCE_SENDTO", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_FORCE_SENDTO", GETPOST("MAIN_MAIL_FORCE_SENDTO", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_ENABLED_USER_DEST_SELECT", GETPOST("MAIN_MAIL_ENABLED_USER_DEST_SELECT", 'int'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_ENABLED_USER_DEST_SELECT", GETPOST("MAIN_MAIL_ENABLED_USER_DEST_SELECT", 'int'), 'chaine', 0, '', $conf->entity);

View File

@ -274,7 +274,7 @@ if (empty($reshook))
if (GETPOST($keycode) == '' && $keycode != 'langcode') $sql .= "null"; // langcode must be '' if not defined so the unique key that include lang will work if (GETPOST($keycode) == '' && $keycode != 'langcode') $sql .= "null"; // langcode must be '' if not defined so the unique key that include lang will work
elseif (GETPOST($keycode) == '0' && $keycode == 'langcode') $sql .= "''"; // langcode must be '' if not defined so the unique key that include lang will work elseif (GETPOST($keycode) == '0' && $keycode == 'langcode') $sql .= "''"; // langcode must be '' if not defined so the unique key that include lang will work
elseif ($keycode == 'fk_user') { elseif ($keycode == 'fk_user') {
if (! $user->admin) { // A non admin user can only edit its own template if (!$user->admin) { // A non admin user can only edit its own template
$sql .= " ".((int) $user->id); $sql .= " ".((int) $user->id);
} else { } else {
$sql .= " ".((int) GETPOST($keycode, 'fk_user')); $sql .= " ".((int) GETPOST($keycode, 'fk_user'));
@ -333,7 +333,7 @@ if (empty($reshook))
if (GETPOST($keycode) == '' || ($keycode != 'langcode' && $keycode != 'position' && $keycode != 'private' && !GETPOST($keycode))) $sql .= "null"; // langcode,... must be '' if not defined so the unique key that include lang will work if (GETPOST($keycode) == '' || ($keycode != 'langcode' && $keycode != 'position' && $keycode != 'private' && !GETPOST($keycode))) $sql .= "null"; // langcode,... must be '' if not defined so the unique key that include lang will work
elseif (GETPOST($keycode) == '0' && $keycode == 'langcode') $sql .= "''"; // langcode must be '' if not defined so the unique key that include lang will work elseif (GETPOST($keycode) == '0' && $keycode == 'langcode') $sql .= "''"; // langcode must be '' if not defined so the unique key that include lang will work
elseif ($keycode == 'fk_user') { elseif ($keycode == 'fk_user') {
if (! $user->admin) { // A non admin user can only edit its own template if (!$user->admin) { // A non admin user can only edit its own template
$sql .= " ".((int) $user->id); $sql .= " ".((int) $user->id);
} else { } else {
$sql .= " ".((int) GETPOST($keycode, 'fk_user')); $sql .= " ".((int) GETPOST($keycode, 'fk_user'));
@ -350,7 +350,7 @@ if (empty($reshook))
} }
$sql .= " WHERE ".$rowidcol." = ".((int) $rowid); $sql .= " WHERE ".$rowidcol." = ".((int) $rowid);
if (! $user->admin) { // A non admin user can only edit its own template if (!$user->admin) { // A non admin user can only edit its own template
$sql .= " AND fk_user = ".$user->id; $sql .= " AND fk_user = ".$user->id;
} }
//print $sql;exit; //print $sql;exit;
@ -371,7 +371,7 @@ if (empty($reshook))
$rowidcol = "rowid"; $rowidcol = "rowid";
$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol."=".((int) $rowid); $sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol."=".((int) $rowid);
if (! $user->admin) { // A non admin user can only edit its own template if (!$user->admin) { // A non admin user can only edit its own template
$sql .= " AND fk_user = ".$user->id; $sql .= " AND fk_user = ".$user->id;
} }
dol_syslog("delete", LOG_DEBUG); dol_syslog("delete", LOG_DEBUG);
@ -493,7 +493,7 @@ if ($action == 'view') {
if ($fieldlist[$field] == 'type') { $valuetoshow = $langs->trans("Type"); } if ($fieldlist[$field] == 'type') { $valuetoshow = $langs->trans("Type"); }
if ($fieldlist[$field] == 'code') { $valuetoshow = $langs->trans("Code"); } if ($fieldlist[$field] == 'code') { $valuetoshow = $langs->trans("Code"); }
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') { $valuetoshow = $langs->trans("Code"); } if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') { $valuetoshow = $langs->trans("Code"); }
if ($fieldlist[$field] == 'type_template') { $valuetoshow = $langs->trans("TypeOfTemplate"); $align="center"; } if ($fieldlist[$field] == 'type_template') { $valuetoshow = $langs->trans("TypeOfTemplate"); $align = "center"; }
if ($fieldlist[$field] == 'private') { $align = 'center'; } if ($fieldlist[$field] == 'private') { $align = 'center'; }
if ($fieldlist[$field] == 'position') { $align = 'center'; } if ($fieldlist[$field] == 'position') { $align = 'center'; }

View File

@ -28,7 +28,7 @@
* \brief Page to activate/disable all modules * \brief Page to activate/disable all modules
*/ */
if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET if (!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
@ -404,7 +404,7 @@ foreach ($modulesdir as $dir)
$familyposition = (empty($familyinfo[$familykey]['position']) ? 0 : $familyinfo[$familykey]['position']); $familyposition = (empty($familyinfo[$familykey]['position']) ? 0 : $familyinfo[$familykey]['position']);
$listOfOfficialModuleGroups = array('hr', 'technic', 'interface', 'technic', 'portal', 'financial', 'crm', 'base', 'products', 'srm', 'ecm', 'projects', 'other'); $listOfOfficialModuleGroups = array('hr', 'technic', 'interface', 'technic', 'portal', 'financial', 'crm', 'base', 'products', 'srm', 'ecm', 'projects', 'other');
if ($external && ! in_array($familykey, $listOfOfficialModuleGroups)) if ($external && !in_array($familykey, $listOfOfficialModuleGroups))
{ {
// If module is extern and into a custom group (not into an official predefined one), it must appear at end (custom groups should not be before official groups). // If module is extern and into a custom group (not into an official predefined one), it must appear at end (custom groups should not be before official groups).
if (is_numeric($familyposition)) { if (is_numeric($familyposition)) {

View File

@ -61,8 +61,8 @@ if ($action == 'settemplates')
$triggername = $reg[1]; $triggername = $reg[1];
$constvalue = GETPOST($key, 'alpha'); $constvalue = GETPOST($key, 'alpha');
$consttype = 'emailtemplate:xxx'; $consttype = 'emailtemplate:xxx';
$tmparray=explode(':', $constvalue); $tmparray = explode(':', $constvalue);
if (! empty($tmparray[0]) && ! empty($tmparray[1])) { if (!empty($tmparray[0]) && !empty($tmparray[1])) {
$constvalue = $tmparray[0]; $constvalue = $tmparray[0];
$consttype = 'emailtemplate:'.$tmparray[1]; $consttype = 'emailtemplate:'.$tmparray[1];
//var_dump($constvalue); //var_dump($constvalue);

View File

@ -156,7 +156,7 @@ if ($mode == 'setup' && $user->admin)
// List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service). // List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service).
// We pass this param list in to 'state' because we need it before and after the redirect. // We pass this param list in to 'state' because we need it before and after the redirect.
$shortscope = 'userinfo_email,userinfo_profile,cloud_print'; $shortscope = 'userinfo_email,userinfo_profile,cloud_print';
if (!empty($conf->global->OAUTH_GSUITE)){ if (!empty($conf->global->OAUTH_GSUITE)) {
$shortscope .= ',admin_directory_user'; $shortscope .= ',admin_directory_user';
} }
//$scope.=',gmail_full'; //$scope.=',gmail_full';

View File

@ -93,7 +93,7 @@ if ($action == 'warehouse')
{ {
$value = GETPOST('default_warehouse', 'alpha'); $value = GETPOST('default_warehouse', 'alpha');
$res = dolibarr_set_const($db, "MAIN_DEFAULT_WAREHOUSE", $value, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "MAIN_DEFAULT_WAREHOUSE", $value, 'chaine', 0, '', $conf->entity);
if ($value == -1 || empty($value) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)){ if ($value == -1 || empty($value) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) {
$res = dolibarr_del_const($db, "MAIN_DEFAULT_WAREHOUSE", $conf->entity); $res = dolibarr_del_const($db, "MAIN_DEFAULT_WAREHOUSE", $conf->entity);
} }
if (!$res > 0) $error++; if (!$res > 0) $error++;
@ -692,7 +692,7 @@ if ($conf->use_javascript_ajax) {
print "</td>\n"; print "</td>\n";
print "</tr>\n"; print "</tr>\n";
if (! empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) { if (!empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("UserWarehouseAutoCreate").'</td>'; print '<td>'.$langs->trans("UserWarehouseAutoCreate").'</td>';
print '<td class="right">'; print '<td class="right">';

View File

@ -213,7 +213,7 @@ foreach ($syslogModules as $moduleName)
print '<input class="oddeven" type="checkbox" name="SYSLOG_HANDLERS[]" value="'.$moduleName.'" '.(in_array($moduleName, $activeModules) ? 'checked' : '').($moduleactive <= 0 ? 'disabled' : '').'> '; print '<input class="oddeven" type="checkbox" name="SYSLOG_HANDLERS[]" value="'.$moduleName.'" '.(in_array($moduleName, $activeModules) ? 'checked' : '').($moduleactive <= 0 ? 'disabled' : '').'> ';
print $module->getName(); print $module->getName();
if ($moduleName == 'mod_syslog_syslog') { if ($moduleName == 'mod_syslog_syslog') {
if (! $module->isActive()) { if (!$module->isActive()) {
$langs->load("errors"); $langs->load("errors");
print $form->textwithpicto('', $langs->trans("ErrorPHPNeedModule", 'SysLog')); print $form->textwithpicto('', $langs->trans("ErrorPHPNeedModule", 'SysLog'));
} }

View File

@ -384,7 +384,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
print '</td></tr>'; print '</td></tr>';
// Activate email notification when a new message is added // Activate email notification when a new message is added
print '<tr class="pair"><td>' . $langs->trans("TicketsPublicNotificationNewMessage") . '</td>'; print '<tr class="pair"><td>'.$langs->trans("TicketsPublicNotificationNewMessage").'</td>';
print '<td class="left">'; print '<td class="left">';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED'); print ajax_constantonoff('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED');
@ -399,9 +399,9 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
print '</tr>'; print '</tr>';
// Send notification when a new message is added to a email if a user is not assigned to the ticket // Send notification when a new message is added to a email if a user is not assigned to the ticket
print '<tr><td>' . $langs->trans("TicketPublicNotificationNewMessageDefaultEmail") . '</label>'; print '<tr><td>'.$langs->trans("TicketPublicNotificationNewMessageDefaultEmail").'</label>';
print '</td><td>'; print '</td><td>';
print '<input type="text" name="TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL" value="' . $conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL . '" size="40" ></td>'; print '<input type="text" name="TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL" value="'.$conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL.'" size="40" ></td>';
print '</td>'; print '</td>';
print '<td align="center">'; print '<td align="center">';
print $form->textwithpicto('', $langs->trans("TicketPublicNotificationNewMessageDefaultEmailHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("TicketPublicNotificationNewMessageDefaultEmailHelp"), 1, 'help');

View File

@ -243,7 +243,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
print '<label for="checkbox_sql_structure">'.$langs->trans('ExportStructure').'</label>'; print '<label for="checkbox_sql_structure">'.$langs->trans('ExportStructure').'</label>';
print '</legend>'; print '</legend>';
print '<input type="checkbox" name="drop"'.((! GETPOSTISSET("drop") || GETPOST('drop')) ? ' checked' : '').' id="checkbox_dump_drop" />'; print '<input type="checkbox" name="drop"'.((!GETPOSTISSET("drop") || GETPOST('drop')) ? ' checked' : '').' id="checkbox_dump_drop" />';
print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>'; print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>';
print '<br>'; print '<br>';
print '</fieldset>'; print '</fieldset>';
@ -304,7 +304,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
print '<br>'; print '<br>';
print '<fieldset><legend>'.$langs->trans('ExportStructure').'</legend>'; print '<fieldset><legend>'.$langs->trans('ExportStructure').'</legend>';
print '<input type="checkbox" name="nobin_drop"'.((! GETPOSTISSET("nobin_drop") || GETPOST('nobin_drop')) ? ' checked' : '').' id="checkbox_dump_drop" />'; print '<input type="checkbox" name="nobin_drop"'.((!GETPOSTISSET("nobin_drop") || GETPOST('nobin_drop')) ? ' checked' : '').' id="checkbox_dump_drop" />';
print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>'; print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>';
print '<br>'; print '<br>';
print '</fieldset>'; print '</fieldset>';

View File

@ -221,6 +221,62 @@ class DolibarrApi
} }
} }
if (!empty($object->thirdparty) && is_object($object->thirdparty))
{
$this->_cleanObjectDatas($object->thirdparty);
}
// Remove the $oldcopy property because it is not supported by the JSON
// encoder. The following error is generated when trying to serialize
// it: "Error encoding/decoding JSON: Type is not supported"
// Note: Event if this property was correctly handled by the JSON
// encoder, it should be ignored because keeping it would let the API
// have a very strange behavior: calling PUT and then GET on the same
// resource would give different results:
// PUT /objects/{id} -> returns object with oldcopy = previous version of the object
// GET /objects/{id} -> returns object with oldcopy empty
unset($object->oldcopy);
// If object has lines, remove $db property
if (isset($object->lines) && is_array($object->lines) && count($object->lines) > 0) {
$nboflines = count($object->lines);
for ($i = 0; $i < $nboflines; $i++)
{
$this->_cleanObjectDatas($object->lines[$i]);
unset($object->lines[$i]->contact);
unset($object->lines[$i]->contact_id);
unset($object->lines[$i]->country);
unset($object->lines[$i]->country_id);
unset($object->lines[$i]->country_code);
unset($object->lines[$i]->mode_reglement_id);
unset($object->lines[$i]->mode_reglement_code);
unset($object->lines[$i]->mode_reglement);
unset($object->lines[$i]->cond_reglement_id);
unset($object->lines[$i]->cond_reglement_code);
unset($object->lines[$i]->cond_reglement);
unset($object->lines[$i]->fk_delivery_address);
unset($object->lines[$i]->fk_projet);
unset($object->lines[$i]->fk_project);
unset($object->lines[$i]->thirdparty);
unset($object->lines[$i]->user);
unset($object->lines[$i]->model_pdf);
unset($object->lines[$i]->modelpdf);
unset($object->lines[$i]->note_public);
unset($object->lines[$i]->note_private);
unset($object->lines[$i]->fk_incoterms);
unset($object->lines[$i]->label_incoterms);
unset($object->lines[$i]->location_incoterms);
unset($object->lines[$i]->name);
unset($object->lines[$i]->lastname);
unset($object->lines[$i]->firstname);
unset($object->lines[$i]->civility_id);
unset($object->lines[$i]->fk_multicurrency);
unset($object->lines[$i]->multicurrency_code);
unset($object->lines[$i]->shipping_method_id);
}
}
if (!empty($object->thirdparty) && is_object($object->thirdparty)) if (!empty($object->thirdparty) && is_object($object->thirdparty))
{ {
$this->_cleanObjectDatas($object->thirdparty); $this->_cleanObjectDatas($object->thirdparty);

View File

@ -419,9 +419,9 @@ class Documents extends DolibarrApi
$object = new Product($this->db); $object = new Product($this->db);
$result = $object->fetch($id, $ref); $result = $object->fetch($id, $ref);
if ($result==0) { if ($result == 0) {
throw new RestException(404, 'Product not found'); throw new RestException(404, 'Product not found');
} elseif ($result<0) { } elseif ($result < 0) {
throw new RestException(500, 'Error while fetching object: '.$object->error); throw new RestException(500, 'Error while fetching object: '.$object->error);
} }

View File

@ -130,9 +130,6 @@ class Asset extends CommonObject
*/ */
public $description; public $description;
public $note_public;
public $note_private;
/** /**
* @var integer|string date_creation * @var integer|string date_creation
*/ */
@ -151,6 +148,9 @@ class Asset extends CommonObject
*/ */
public $fk_user_modif; public $fk_user_modif;
/**
* @var string import key
*/
public $import_key; public $import_key;
/** /**

View File

@ -1005,9 +1005,9 @@ class BOM extends CommonObject
foreach ($this->lines as &$line) { foreach ($this->lines as &$line) {
$tmpproduct = new Product($this->db); $tmpproduct = new Product($this->db);
$result= $tmpproduct->fetch($line->fk_product); $result = $tmpproduct->fetch($line->fk_product);
if ($result < 0) { if ($result < 0) {
$this->error=$tmpproduct->error; $this->error = $tmpproduct->error;
return -1; return -1;
} }
$line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp); $line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);

View File

@ -1551,7 +1551,7 @@ class Categorie extends CommonObject
if (colorIsLight($this->color)) $forced_color = 'categtextblack'; if (colorIsLight($this->color)) $forced_color = 'categtextblack';
} }
$link = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.$moreparam.'&backtopage='.urlencode($_SERVER['PHP_SELF'].($moreparam?'?'.$moreparam:'')).'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip '.$forced_color.'">'; $link = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.$moreparam.'&backtopage='.urlencode($_SERVER['PHP_SELF'].($moreparam ? '?'.$moreparam : '')).'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip '.$forced_color.'">';
$linkend = '</a>'; $linkend = '</a>';
$picto = 'category'; $picto = 'category';

View File

@ -390,7 +390,7 @@ if (empty($reshook) && $action == 'add')
if ($user->id != $object->userownerid) $moreparam = "filtert=-1"; // We force to remove filter so created record is visible when going back to per user view. if ($user->id != $object->userownerid) $moreparam = "filtert=-1"; // We force to remove filter so created record is visible when going back to per user view.
// Create reminders // Create reminders
if ($addreminder == 'on'){ if ($addreminder == 'on') {
$actionCommReminder = new ActionCommReminder($db); $actionCommReminder = new ActionCommReminder($db);
$dateremind = dol_time_plus_duree($datep, -$offsetvalue, $offsetunit); $dateremind = dol_time_plus_duree($datep, -$offsetvalue, $offsetunit);
@ -409,7 +409,7 @@ if (empty($reshook) && $action == 'add')
$actionCommReminder->fk_user = $userassigned['id']; $actionCommReminder->fk_user = $userassigned['id'];
$res = $actionCommReminder->create($user); $res = $actionCommReminder->create($user);
if ($res <= 0){ if ($res <= 0) {
// If error // If error
$db->rollback(); $db->rollback();
$langs->load("errors"); $langs->load("errors");
@ -646,7 +646,7 @@ if (empty($reshook) && $action == 'update')
} }
//Create reminders //Create reminders
if ($addreminder == 'on' && $object->datep > dol_now()){ if ($addreminder == 'on' && $object->datep > dol_now()) {
$actionCommReminder = new ActionCommReminder($db); $actionCommReminder = new ActionCommReminder($db);
$dateremind = dol_time_plus_duree($datep, -$offsetvalue, $offsetunit); $dateremind = dol_time_plus_duree($datep, -$offsetvalue, $offsetunit);
@ -665,7 +665,7 @@ if (empty($reshook) && $action == 'update')
$actionCommReminder->fk_user = $userassigned['id']; $actionCommReminder->fk_user = $userassigned['id'];
$res = $actionCommReminder->create($user); $res = $actionCommReminder->create($user);
if ($res <= 0){ if ($res <= 0) {
// If error // If error
$langs->load("errors"); $langs->load("errors");
$error = $langs->trans('ErrorReminderActionCommCreation'); $error = $langs->trans('ErrorReminderActionCommCreation');
@ -1206,7 +1206,7 @@ if ($action == 'create')
} }
// Priority // Priority
if (! empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) { if (!empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) {
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td colspan="3">'; print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td colspan="3">';
print '<input type="text" name="priority" value="'.(GETPOSTISSET('priority') ? GETPOST('priority', 'int') : ($object->priority ? $object->priority : '')).'" size="5">'; print '<input type="text" name="priority" value="'.(GETPOSTISSET('priority') ? GETPOST('priority', 'int') : ($object->priority ? $object->priority : '')).'" size="5">';
print '</td></tr>'; print '</td></tr>';
@ -1635,7 +1635,7 @@ if ($id > 0)
} }
// Priority // Priority
if (! empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) { if (!empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) {
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td>'; print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td>';
print '<input type="text" name="priority" value="'.($object->priority ? $object->priority : '').'" size="5">'; print '<input type="text" name="priority" value="'.($object->priority ? $object->priority : '').'" size="5">';
print '</td></tr>'; print '</td></tr>';

View File

@ -162,12 +162,12 @@ class CActionComm
if ($qualified && $obj->module) if ($qualified && $obj->module)
{ {
if ($obj->module == 'invoice' && !$conf->facture->enabled) $qualified=0; if ($obj->module == 'invoice' && !$conf->facture->enabled) $qualified = 0;
if ($obj->module == 'order' && !$conf->commande->enabled) $qualified=0; if ($obj->module == 'order' && !$conf->commande->enabled) $qualified = 0;
if ($obj->module == 'propal' && !$conf->propal->enabled) $qualified=0; if ($obj->module == 'propal' && !$conf->propal->enabled) $qualified = 0;
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ! $conf->supplier_invoice->enabled)) $qualified=0; if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !$conf->supplier_invoice->enabled)) $qualified = 0;
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ! $conf->supplier_order->enabled)) $qualified=0; if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !$conf->supplier_order->enabled)) $qualified = 0;
if ($obj->module == 'shipping' && !$conf->expedition->enabled) $qualified=0; if ($obj->module == 'shipping' && !$conf->expedition->enabled) $qualified = 0;
} }
if ($qualified) if ($qualified)

View File

@ -487,7 +487,7 @@ if ($object->id > 0)
print '</tr>'; print '</tr>';
} }
if (! empty($conf->intracommreport->enabled)) if (!empty($conf->intracommreport->enabled))
{ {
// Transport mode by default // Transport mode by default
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
@ -675,15 +675,15 @@ if ($object->id > 0)
if ($outstandingOpened != $outstandingOpenedLate && !empty($outstandingOpenedLate)) { if ($outstandingOpened != $outstandingOpenedLate && !empty($outstandingOpenedLate)) {
$warn = ''; $warn = '';
if ($object->outstanding_limit != '' && $object->outstanding_limit < $outstandingOpenedLate) { if ($object->outstanding_limit != '' && $object->outstanding_limit < $outstandingOpenedLate) {
$warn = ' ' . img_warning($langs->trans("OutstandingBillReached")); $warn = ' '.img_warning($langs->trans("OutstandingBillReached"));
} }
$text = $langs->trans("CurrentOutstandingBillLate"); $text = $langs->trans("CurrentOutstandingBillLate");
$link = DOL_URL_ROOT . '/compta/recap-compta.php?socid=' . $object->id; $link = DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id;
$icon = 'bill'; $icon = 'bill';
if ($link) $boxstat .= '<a href="' . $link . '" class="boxstatsindicator thumbstat nobold nounderline">'; if ($link) $boxstat .= '<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
$boxstat .= '<div class="boxstats" title="' . dol_escape_htmltag($text) . '">'; $boxstat .= '<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
$boxstat .= '<span class="boxstatstext">' . img_object("", $icon) . ' <span>' . $text . '</span></span><br>'; $boxstat .= '<span class="boxstatstext">'.img_object("", $icon).' <span>'.$text.'</span></span><br>';
$boxstat .= '<span class="boxstatsindicator' . ($outstandingOpenedLate > 0 ? ' amountremaintopay' : '') . '">'.price($outstandingOpenedLate, 1, $langs, 1, -1, -1, $conf->currency) . $warn . '</span>'; $boxstat .= '<span class="boxstatsindicator'.($outstandingOpenedLate > 0 ? ' amountremaintopay' : '').'">'.price($outstandingOpenedLate, 1, $langs, 1, -1, -1, $conf->currency).$warn.'</span>';
$boxstat .= '</div>'; $boxstat .= '</div>';
if ($link) $boxstat .= '</a>'; if ($link) $boxstat .= '</a>';
} }
@ -973,7 +973,7 @@ if ($object->id > 0)
$late = ''; $late = '';
foreach ($contrat->lines as $line) { foreach ($contrat->lines as $line) {
if ($contrat->statut == Contrat::STATUS_VALIDATED && $line->statut == ContratLigne::STATUS_OPEN) { if ($contrat->statut == Contrat::STATUS_VALIDATED && $line->statut == ContratLigne::STATUS_OPEN) {
if (((!empty($line->date_fin_validite)?$line->date_fin_validite:0) + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late")); if (((!empty($line->date_fin_validite) ? $line->date_fin_validite : 0) + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late"));
} }
} }

View File

@ -224,8 +224,8 @@ class Mailing extends CommonObject
$this->title = $obj->title; $this->title = $obj->title;
$this->sujet = $obj->sujet; $this->sujet = $obj->sujet;
if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($obj->body, ENT_COMPAT|ENT_HTML5))) { if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($obj->body, ENT_COMPAT | ENT_HTML5))) {
$this->body = dol_html_entity_decode($obj->body, ENT_COMPAT|ENT_HTML5); $this->body = dol_html_entity_decode($obj->body, ENT_COMPAT | ENT_HTML5);
} else { } else {
$this->body = $obj->body; $this->body = $obj->body;
} }

View File

@ -13,7 +13,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -214,8 +214,6 @@ class Propal extends CommonObject
public $labelStatus = array(); public $labelStatus = array();
public $labelStatusShort = array(); public $labelStatusShort = array();
public $specimen;
// Multicurrency // Multicurrency
/** /**
* @var int ID * @var int ID
@ -1352,7 +1350,7 @@ class Propal extends CommonObject
$object->id = 0; $object->id = 0;
$object->ref = ''; $object->ref = '';
$object->entity = (! empty($forceentity) ? $forceentity : $object->entity); $object->entity = (!empty($forceentity) ? $forceentity : $object->entity);
$object->statut = self::STATUS_DRAFT; $object->statut = self::STATUS_DRAFT;
// Clear fields // Clear fields
@ -4149,7 +4147,7 @@ class PropaleLigne extends CommonObjectLine
$pa_ht_isemptystring = (empty($this->pa_ht) && $this->pa_ht == ''); // If true, we can use a default value. If this->pa_ht = '0', we must use '0'. $pa_ht_isemptystring = (empty($this->pa_ht) && $this->pa_ht == ''); // If true, we can use a default value. If this->pa_ht = '0', we must use '0'.
if (empty($this->id) && ! empty($this->rowid)) $this->id = $this->rowid; if (empty($this->id) && !empty($this->rowid)) $this->id = $this->rowid;
// Clean parameters // Clean parameters
if (empty($this->tva_tx)) $this->tva_tx = 0; if (empty($this->tva_tx)) $this->tva_tx = 0;

View File

@ -88,7 +88,7 @@ class CommandeStats extends Stats
//$this->where .= " c.fk_statut > 2"; // Only approved & ordered //$this->where .= " c.fk_statut > 2"; // Only approved & ordered
} }
//$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; //$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity;
$this->where .= ($this->where ? ' AND ' : ''). 'c.entity IN ('.getEntity('commande').')'; $this->where .= ($this->where ? ' AND ' : '').'c.entity IN ('.getEntity('commande').')';
if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($this->socid) if ($this->socid)

View File

@ -67,7 +67,7 @@ $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (!$sortfield) $sortfield = "v.datep,v.rowid"; if (!$sortfield) $sortfield = "v.datep,v.rowid";
if (!$sortorder) $sortorder="DESC,DESC"; if (!$sortorder) $sortorder = "DESC,DESC";
$filtre = GETPOST("filtre", 'alpha'); $filtre = GETPOST("filtre", 'alpha');

View File

@ -419,7 +419,7 @@ if (empty($reshook))
$db->begin(); $db->begin();
if (! $error) { if (!$error) {
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
if ($result < 0) { if ($result < 0) {
$error++; $error++;
@ -427,7 +427,7 @@ if (empty($reshook))
} }
} }
if (! $error) { if (!$error) {
$old_date_lim_reglement = $object->date_lim_reglement; $old_date_lim_reglement = $object->date_lim_reglement;
$new_date_lim_reglement = $object->calculate_date_lim_reglement(); $new_date_lim_reglement = $object->calculate_date_lim_reglement();
if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement = $new_date_lim_reglement; if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement = $new_date_lim_reglement;

View File

@ -1010,10 +1010,10 @@ class Invoices extends DolibarrApi
$discountcheck = new DiscountAbsolute($this->db); $discountcheck = new DiscountAbsolute($this->db);
$result = $discountcheck->fetch(0, $this->invoice->id); $result = $discountcheck->fetch(0, $this->invoice->id);
if ($result == 0){ if ($result == 0) {
throw new RestException(404, 'Discount not found'); throw new RestException(404, 'Discount not found');
} }
if ($result < 0){ if ($result < 0) {
throw new RestException(500, $discountcheck->error); throw new RestException(500, $discountcheck->error);
} }

View File

@ -95,6 +95,9 @@ class Facture extends CommonInvoice
*/ */
protected $table_ref_field = 'ref'; protected $table_ref_field = 'ref';
/**
* @var int thirdparty ID
*/
public $socid; public $socid;
public $author; public $author;
@ -111,6 +114,10 @@ class Facture extends CommonInvoice
public $date; // Date invoice public $date; // Date invoice
public $datem; public $datem;
/**
* @var string customer ref
*/
public $ref_client; public $ref_client;
/** /**
@ -169,7 +176,6 @@ class Facture extends CommonInvoice
public $line; public $line;
public $extraparams = array(); public $extraparams = array();
public $specimen;
public $fac_rec; public $fac_rec;

View File

@ -469,7 +469,7 @@ function getOpenTable($maxCount = 500, $socid = 0)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$objectstatic->id= $obj->id; $objectstatic->id = $obj->id;
$objectstatic->ref = $obj->ref; $objectstatic->ref = $obj->ref;
$companystatic->id = $obj->socid; $companystatic->id = $obj->socid;

View File

@ -206,10 +206,10 @@ $arrayfields = array(
'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>200), 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>200),
'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>210), 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>210),
'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>220), // Not enabled by default because slow 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>220), // Not enabled by default because slow
'total_pa' => array('label' => ($conf->global->MARGIN_TYPE == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous?0:1)), 'total_pa' => array('label' => ($conf->global->MARGIN_TYPE == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)),
'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous?0:1)), 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES)?0:1)), 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES)?0:1)), 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)),
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))),
@ -306,8 +306,8 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
} }
if ($massaction == 'makepayment'){ if ($massaction == 'makepayment') {
$arrayofselected=is_array($toselect)?$toselect:array(); $arrayofselected = is_array($toselect) ? $toselect : array();
$loc = dol_buildpath('/compta/paiement.php', 2).'?action=create&facids='.implode(',', $arrayofselected); $loc = dol_buildpath('/compta/paiement.php', 2).'?action=create&facids='.implode(',', $arrayofselected);
@ -1585,25 +1585,25 @@ if ($resql)
// Total buying or cost price // Total buying or cost price
if (!empty($arrayfields['total_pa']['checked'])) if (!empty($arrayfields['total_pa']['checked']))
{ {
print '<td class="right nowrap">' . price($marginInfo['pa_total']) . '</td>'; print '<td class="right nowrap">'.price($marginInfo['pa_total']).'</td>';
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
} }
// Total margin // Total margin
if (!empty($arrayfields['total_margin']['checked'])) if (!empty($arrayfields['total_margin']['checked']))
{ {
print '<td class="right nowrap">' . price($marginInfo['total_margin']) . '</td>'; print '<td class="right nowrap">'.price($marginInfo['total_margin']).'</td>';
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
} }
// Total margin rate // Total margin rate
if (!empty($arrayfields['total_margin_rate']['checked'])) if (!empty($arrayfields['total_margin_rate']['checked']))
{ {
print '<td class="right nowrap">' . (($marginInfo['total_margin_rate'] == '')?'':price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%') . '</td>'; print '<td class="right nowrap">'.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').'</td>';
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
} }
// total mark rate // total mark rate
if (!empty($arrayfields['total_mark_rate']['checked'])) if (!empty($arrayfields['total_mark_rate']['checked']))
{ {
print '<td class="right nowrap">' . (($marginInfo['total_mark_rate'] == '')?'':price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%') . '</td>'; print '<td class="right nowrap">'.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').'</td>';
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
} }

View File

@ -60,8 +60,8 @@ if ($user->socid > 0)
$nowyear = strftime("%Y", dol_now()); $nowyear = strftime("%Y", dol_now());
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
if (!empty($conf->global->INVOICE_STATS_GRAPHS_SHOW_2_YEARS)) $startyear=$year-2; if (!empty($conf->global->INVOICE_STATS_GRAPHS_SHOW_2_YEARS)) $startyear = $year - 2;
else $startyear=$year-1; else $startyear = $year - 1;
$endyear = $year; $endyear = $year;
@ -269,7 +269,7 @@ if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisL
print '</td></tr>'; print '</td></tr>';
// Category // Category
if (! empty($conf->category->enabled)) { if (!empty($conf->category->enabled)) {
if ($mode == 'customer') if ($mode == 'customer')
{ {
$cat_type = Categorie::TYPE_CUSTOMER; $cat_type = Categorie::TYPE_CUSTOMER;

View File

@ -503,7 +503,7 @@ class Paiement extends CommonObject
{ {
$accline = new AccountLine($this->db); $accline = new AccountLine($this->db);
$result=$accline->fetch($bank_line_id); $result = $accline->fetch($bank_line_id);
if ($result == 0) { if ($result == 0) {
$accline->id = $accline->rowid = $bank_line_id; // If not found, we set artificially rowid to allow delete of llx_bank_url $accline->id = $accline->rowid = $bank_line_id; // If not found, we set artificially rowid to allow delete of llx_bank_url
} }

View File

@ -159,7 +159,7 @@ class RejetPrelevement
* PHP installs sends only the part integer negative * PHP installs sends only the part integer negative
*/ */
$pai->amounts[$facs[$i][0]] = price2num($facs[$i][1] * ($this->type == 'bank-transfer' ? 1: -1)); $pai->amounts[$facs[$i][0]] = price2num($facs[$i][1] * ($this->type == 'bank-transfer' ? 1 : -1));
$pai->datepaye = $date_rejet; $pai->datepaye = $date_rejet;
$pai->paiementid = 3; // type of payment: withdrawal $pai->paiementid = 3; // type of payment: withdrawal
$pai->num_payment = $fac->ref; $pai->num_payment = $fac->ref;
@ -218,7 +218,7 @@ class RejetPrelevement
$sql = "SELECT fk_user_demande"; $sql = "SELECT fk_user_demande";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
$sql .= " WHERE pfd.fk_prelevement_bons = ".$this->bon_id; $sql .= " WHERE pfd.fk_prelevement_bons = ".$this->bon_id;
$sql .= " AND pfd.fk_facture".($this->type == 'bank-transfer' ? '_fourn=': '=').$fac->id; $sql .= " AND pfd.fk_facture".($this->type == 'bank-transfer' ? '_fourn=' : '=').$fac->id;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)

View File

@ -181,7 +181,7 @@ $limit = 5;
$sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut"; $sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " WHERE p.type = 'debit-order'"; $sql .= " WHERE p.type = 'debit-order'";
$sql .= " AND entity IN (" . getEntity('prelevement') . ")"; $sql .= " AND entity IN (".getEntity('prelevement').")";
$sql .= " ORDER BY datec DESC"; $sql .= " ORDER BY datec DESC";
$sql .= $db->plimit($limit); $sql .= $db->plimit($limit);

View File

@ -44,12 +44,12 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '
// Security check // Security check
$socid = GETPOST('socid', 'int'); $socid = GETPOST('socid', 'int');
if ($user->socid) $socid=$user->socid; if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'prelevement', '', '', 'bons'); $result = restrictedArea($user, 'prelevement', '', '', 'bons');
$type = GETPOST('type', 'aZ09'); $type = GETPOST('type', 'aZ09');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');

View File

@ -367,7 +367,7 @@ class Contact extends CommonObject
$sql .= ", firstname"; $sql .= ", firstname";
$sql .= ", fk_user_creat"; $sql .= ", fk_user_creat";
$sql .= ", priv"; $sql .= ", priv";
$sql.= ", fk_stcommcontact"; $sql .= ", fk_stcommcontact";
$sql .= ", statut"; $sql .= ", statut";
$sql .= ", canvas"; $sql .= ", canvas";
$sql .= ", entity"; $sql .= ", entity";
@ -381,7 +381,7 @@ class Contact extends CommonObject
$sql .= "'".$this->db->escape($this->firstname)."',"; $sql .= "'".$this->db->escape($this->firstname)."',";
$sql .= " ".($user->id > 0 ? "'".$this->db->escape($user->id)."'" : "null").","; $sql .= " ".($user->id > 0 ? "'".$this->db->escape($user->id)."'" : "null").",";
$sql .= " ".$this->db->escape($this->priv).","; $sql .= " ".$this->db->escape($this->priv).",";
$sql.= " 0,"; $sql .= " 0,";
$sql .= " ".$this->db->escape($this->statut).","; $sql .= " ".$this->db->escape($this->statut).",";
$sql .= " ".(!empty($this->canvas) ? "'".$this->db->escape($this->canvas)."'" : "null").","; $sql .= " ".(!empty($this->canvas) ? "'".$this->db->escape($this->canvas)."'" : "null").",";
$sql .= " ".$this->db->escape($this->entity).","; $sql .= " ".$this->db->escape($this->entity).",";
@ -861,7 +861,7 @@ class Contact extends CommonObject
$sql .= " c.socialnetworks,"; $sql .= " c.socialnetworks,";
$sql .= " c.photo,"; $sql .= " c.photo,";
$sql .= " c.priv, c.note_private, c.note_public, c.default_lang, c.canvas,"; $sql .= " c.priv, c.note_private, c.note_public, c.default_lang, c.canvas,";
$sql.= " c.fk_prospectcontactlevel, c.fk_stcommcontact, st.libelle as stcomm, st.picto as stcomm_picto,"; $sql .= " c.fk_prospectcontactlevel, c.fk_stcommcontact, st.libelle as stcomm, st.picto as stcomm_picto,";
$sql .= " c.import_key,"; $sql .= " c.import_key,";
$sql .= " c.datec as date_creation, c.tms as date_modification,"; $sql .= " c.datec as date_creation, c.tms as date_modification,";
$sql .= " co.label as country, co.code as country_code,"; $sql .= " co.label as country, co.code as country_code,";
@ -873,7 +873,7 @@ class Contact extends CommonObject
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON c.fk_departement = d.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON c.fk_departement = d.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.rowid = u.fk_socpeople"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.rowid = u.fk_socpeople";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid";
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_stcommcontact as st ON c.fk_stcommcontact = st.id'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_stcommcontact as st ON c.fk_stcommcontact = st.id';
if ($id) $sql .= " WHERE c.rowid = ".((int) $id); if ($id) $sql .= " WHERE c.rowid = ".((int) $id);
else { else {
$sql .= " WHERE c.entity IN (".getEntity($this->element).")"; $sql .= " WHERE c.entity IN (".getEntity($this->element).")";
@ -931,8 +931,8 @@ class Contact extends CommonObject
$this->fk_prospectlevel = $obj->fk_prospectcontactlevel; $this->fk_prospectlevel = $obj->fk_prospectcontactlevel;
$transcode=$langs->trans('StatusProspect'.$obj->fk_stcommcontact); $transcode = $langs->trans('StatusProspect'.$obj->fk_stcommcontact);
$libelle=($transcode!='StatusProspect'.$obj->fk_stcommcontact?$transcode:$obj->stcomm); $libelle = ($transcode != 'StatusProspect'.$obj->fk_stcommcontact ? $transcode : $obj->stcomm);
$this->stcomm_id = $obj->fk_stcommcontact; // id statut commercial $this->stcomm_id = $obj->fk_stcommcontact; // id statut commercial
$this->statut_commercial = $libelle; // libelle statut commercial $this->statut_commercial = $libelle; // libelle statut commercial
$this->stcomm_picto = $obj->stcomm_picto; // Picto statut commercial $this->stcomm_picto = $obj->stcomm_picto; // Picto statut commercial
@ -1766,15 +1766,15 @@ class Contact extends CommonObject
{ {
global $langs; global $langs;
$sql = "SELECT id, code, libelle as label, picto FROM " . MAIN_DB_PREFIX . "c_stcommcontact"; $sql = "SELECT id, code, libelle as label, picto FROM ".MAIN_DB_PREFIX."c_stcommcontact";
if ($active >= 0) $sql .= " WHERE active = " . $active; if ($active >= 0) $sql .= " WHERE active = ".$active;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
$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);
$this->cacheprospectstatus[$obj->id] = array('id' => $obj->id, 'code' => $obj->code, 'label' => ($langs->trans("ST_" . strtoupper($obj->code)) == "ST_" . strtoupper($obj->code)) ? $obj->label : $langs->trans("ST_" . strtoupper($obj->code)), 'picto' => $obj->picto); $this->cacheprospectstatus[$obj->id] = array('id' => $obj->id, 'code' => $obj->code, 'label' => ($langs->trans("ST_".strtoupper($obj->code)) == "ST_".strtoupper($obj->code)) ? $obj->label : $langs->trans("ST_".strtoupper($obj->code)), 'picto' => $obj->picto);
$i++; $i++;
} }
return 1; return 1;
@ -1800,9 +1800,9 @@ class Contact extends CommonObject
{ {
global $langs; global $langs;
$lib = $langs->trans("ProspectLevel" . $fk_prospectlevel); $lib = $langs->trans("ProspectLevel".$fk_prospectlevel);
// If lib not found in language file, we get label from cache/databse // If lib not found in language file, we get label from cache/databse
if ($lib == $langs->trans("ProspectLevel" . $fk_prospectlevel)) if ($lib == $langs->trans("ProspectLevel".$fk_prospectlevel))
{ {
$lib = $langs->getLabelFromKey($this->db, $fk_prospectlevel, 'c_prospectlevel', 'code', 'label'); $lib = $langs->getLabelFromKey($this->db, $fk_prospectlevel, 'c_prospectlevel', 'code', 'label');
} }
@ -1854,13 +1854,13 @@ class Contact extends CommonObject
if ($mode == 2) if ($mode == 2)
{ {
if ($statut == '-1' || $statut == 'ST_NO') return img_action($langs->trans("StatusProspect-1"), -1, $picto) . ' ' . $langs->trans("StatusProspect-1"); if ($statut == '-1' || $statut == 'ST_NO') return img_action($langs->trans("StatusProspect-1"), -1, $picto).' '.$langs->trans("StatusProspect-1");
elseif ($statut == '0' || $statut == 'ST_NEVER') return img_action($langs->trans("StatusProspect0"), 0, $picto) . ' ' . $langs->trans("StatusProspect0"); elseif ($statut == '0' || $statut == 'ST_NEVER') return img_action($langs->trans("StatusProspect0"), 0, $picto).' '.$langs->trans("StatusProspect0");
elseif ($statut == '1' || $statut == 'ST_TODO') return img_action($langs->trans("StatusProspect1"), 1, $picto) . ' ' . $langs->trans("StatusProspect1"); elseif ($statut == '1' || $statut == 'ST_TODO') return img_action($langs->trans("StatusProspect1"), 1, $picto).' '.$langs->trans("StatusProspect1");
elseif ($statut == '2' || $statut == 'ST_PEND') return img_action($langs->trans("StatusProspect2"), 2, $picto) . ' ' . $langs->trans("StatusProspect2"); elseif ($statut == '2' || $statut == 'ST_PEND') return img_action($langs->trans("StatusProspect2"), 2, $picto).' '.$langs->trans("StatusProspect2");
elseif ($statut == '3' || $statut == 'ST_DONE') return img_action($langs->trans("StatusProspect3"), 3, $picto) . ' ' . $langs->trans("StatusProspect3"); elseif ($statut == '3' || $statut == 'ST_DONE') return img_action($langs->trans("StatusProspect3"), 3, $picto).' '.$langs->trans("StatusProspect3");
else { else {
return img_action(($langs->trans("StatusProspect" . $statut) != "StatusProspect" . $statut) ? $langs->trans("StatusProspect" . $statut) : $label, 0, $picto) . ' ' . (($langs->trans("StatusProspect" . $statut) != "StatusProspect" . $statut) ? $langs->trans("StatusProspect" . $statut) : $label); return img_action(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label, 0, $picto).' '.(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label);
} }
} }
if ($mode == 3) if ($mode == 3)
@ -1871,18 +1871,18 @@ class Contact extends CommonObject
elseif ($statut == '2' || $statut == 'ST_PEND') return img_action($langs->trans("StatusProspect2"), 2, $picto); elseif ($statut == '2' || $statut == 'ST_PEND') return img_action($langs->trans("StatusProspect2"), 2, $picto);
elseif ($statut == '3' || $statut == 'ST_DONE') return img_action($langs->trans("StatusProspect3"), 3, $picto); elseif ($statut == '3' || $statut == 'ST_DONE') return img_action($langs->trans("StatusProspect3"), 3, $picto);
else { else {
return img_action(($langs->trans("StatusProspect" . $statut) != "StatusProspect" . $statut) ? $langs->trans("StatusProspect" . $statut) : $label, 0, $picto); return img_action(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label, 0, $picto);
} }
} }
if ($mode == 4) if ($mode == 4)
{ {
if ($statut == '-1' || $statut == 'ST_NO') return img_action($langs->trans("StatusProspect-1"), -1, $picto) . ' ' . $langs->trans("StatusProspect-1"); if ($statut == '-1' || $statut == 'ST_NO') return img_action($langs->trans("StatusProspect-1"), -1, $picto).' '.$langs->trans("StatusProspect-1");
elseif ($statut == '0' || $statut == 'ST_NEVER') return img_action($langs->trans("StatusProspect0"), 0, $picto) . ' ' . $langs->trans("StatusProspect0"); elseif ($statut == '0' || $statut == 'ST_NEVER') return img_action($langs->trans("StatusProspect0"), 0, $picto).' '.$langs->trans("StatusProspect0");
elseif ($statut == '1' || $statut == 'ST_TODO') return img_action($langs->trans("StatusProspect1"), 1, $picto) . ' ' . $langs->trans("StatusProspect1"); elseif ($statut == '1' || $statut == 'ST_TODO') return img_action($langs->trans("StatusProspect1"), 1, $picto).' '.$langs->trans("StatusProspect1");
elseif ($statut == '2' || $statut == 'ST_PEND') return img_action($langs->trans("StatusProspect2"), 2, $picto) . ' ' . $langs->trans("StatusProspect2"); elseif ($statut == '2' || $statut == 'ST_PEND') return img_action($langs->trans("StatusProspect2"), 2, $picto).' '.$langs->trans("StatusProspect2");
elseif ($statut == '3' || $statut == 'ST_DONE') return img_action($langs->trans("StatusProspect3"), 3, $picto) . ' ' . $langs->trans("StatusProspect3"); elseif ($statut == '3' || $statut == 'ST_DONE') return img_action($langs->trans("StatusProspect3"), 3, $picto).' '.$langs->trans("StatusProspect3");
else { else {
return img_action(($langs->trans("StatusProspect" . $statut) != "StatusProspect" . $statut) ? $langs->trans("StatusProspect" . $statut) : $label, 0, $picto) . ' ' . (($langs->trans("StatusProspect" . $statut) != "StatusProspect" . $statut) ? $langs->trans("StatusProspect" . $statut) : $label); return img_action(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label, 0, $picto).' '.(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label);
} }
} }

View File

@ -148,7 +148,7 @@ if ($object->thirdparty->fournisseur)
{ {
$thirdTypeArray['supplier'] = $langs->trans("supplier"); $thirdTypeArray['supplier'] = $langs->trans("supplier");
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) $elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices'); if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) $elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices');
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) $elementTypeArray['supplier_order']= $langs->transnoentitiesnoconv('SuppliersOrders'); if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) $elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders');
// There no contact type for supplier proposals // There no contact type for supplier proposals
// if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->supplier_proposal->lire) $elementTypeArray['supplier_proposal']=$langs->transnoentitiesnoconv('SupplierProposals'); // if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->supplier_proposal->lire) $elementTypeArray['supplier_proposal']=$langs->transnoentitiesnoconv('SupplierProposals');

View File

@ -66,7 +66,7 @@ $v->setPhoneNumber($contact->phone_pro, "TYPE=WORK;VOICE");
$v->setPhoneNumber($contact->phone_mobile, "TYPE=CELL;VOICE"); $v->setPhoneNumber($contact->phone_mobile, "TYPE=CELL;VOICE");
$v->setPhoneNumber($contact->fax, "TYPE=WORK;FAX"); $v->setPhoneNumber($contact->fax, "TYPE=WORK;FAX");
$country = $contact->country_code ? $contact->country : '' ; $country = $contact->country_code ? $contact->country : '';
$v->setAddress("", "", $contact->address, $contact->town, $contact->state, $contact->zip, $country, "TYPE=WORK;POSTAL"); $v->setAddress("", "", $contact->address, $contact->town, $contact->state, $contact->zip, $country, "TYPE=WORK;POSTAL");
$v->setLabel("", "", $contact->address, $contact->town, $contact->state, $contact->zip, $country, "TYPE=WORK"); $v->setLabel("", "", $contact->address, $contact->town, $contact->state, $contact->zip, $country, "TYPE=WORK");
@ -79,9 +79,9 @@ $v->setTitle($contact->poste);
if ($company->id) if ($company->id)
{ {
$v->setURL($company->url, "TYPE=WORK"); $v->setURL($company->url, "TYPE=WORK");
if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE"); if (!$contact->phone_pro) $v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE");
if (! $contact->fax) $v->setPhoneNumber($company->fax, "TYPE=WORK;FAX"); if (!$contact->fax) $v->setPhoneNumber($company->fax, "TYPE=WORK;FAX");
if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, $company->state, $company->zip, $company->country, "TYPE=WORK;POSTAL"); if (!$contact->zip) $v->setAddress("", "", $company->address, $company->town, $company->state, $company->zip, $company->country, "TYPE=WORK;POSTAL");
// when company e-mail is empty, use only contact e-mail // when company e-mail is empty, use only contact e-mail
if (empty(trim($company->email))) if (empty(trim($company->email)))

View File

@ -1489,7 +1489,7 @@ if ($action == 'create')
if ($action != 'editline' || GETPOST('rowid') != $objp->rowid) if ($action != 'editline' || GETPOST('rowid') != $objp->rowid)
{ {
$moreparam = ''; $moreparam = '';
if (! empty($conf->global->CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT) && $objp->statut == ContratLigne::STATUS_CLOSED && $action != 'showclosedlines') $moreparam = 'style="display: none;"'; if (!empty($conf->global->CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT) && $objp->statut == ContratLigne::STATUS_CLOSED && $action != 'showclosedlines') $moreparam = 'style="display: none;"';
print '<tr class="tdtop oddeven" '.$moreparam.'>'; print '<tr class="tdtop oddeven" '.$moreparam.'>';
// Label // Label
if ($objp->fk_product > 0) if ($objp->fk_product > 0)
@ -1622,7 +1622,7 @@ if ($action == 'create')
$line = new ContratLigne($db); $line = new ContratLigne($db);
$line->id = $objp->rowid; $line->id = $objp->rowid;
$line->fetch_optionals(); $line->fetch_optionals();
print $line->showOptionals($extrafields, 'view', array('class'=>'oddeven','style'=>$moreparam, 'colspan'=>$colspan), '', '', 1); print $line->showOptionals($extrafields, 'view', array('class'=>'oddeven', 'style'=>$moreparam, 'colspan'=>$colspan), '', '', 1);
} }
} }
// Line in mode update // Line in mode update
@ -1734,7 +1734,7 @@ if ($action == 'create')
if ($object->statut > 0) if ($object->statut > 0)
{ {
$moreparam = ''; $moreparam = '';
if (! empty($conf->global->CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT) && $object->lines[$cursorline-1]->statut == ContratLigne::STATUS_CLOSED && $action != 'showclosedlines') $moreparam = 'style="display: none;"'; if (!empty($conf->global->CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT) && $object->lines[$cursorline - 1]->statut == ContratLigne::STATUS_CLOSED && $action != 'showclosedlines') $moreparam = 'style="display: none;"';
print '<tr class="oddeven" '.$moreparam.'>'; print '<tr class="oddeven" '.$moreparam.'>';
print '<td class="tdhrthin" colspan="'.($conf->margin->enabled ? 7 : 6).'"><hr class="opacitymedium tdhrthin"></td>'; print '<td class="tdhrthin" colspan="'.($conf->margin->enabled ? 7 : 6).'"><hr class="opacitymedium tdhrthin"></td>';
print "</tr>\n"; print "</tr>\n";
@ -2092,7 +2092,7 @@ if ($action == 'create')
//} //}
} }
if (! empty($conf->global->CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT) && $object->nbofservicesclosed > 0) if (!empty($conf->global->CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT) && $object->nbofservicesclosed > 0)
{ {
if ($action == 'showclosedlines') print '<div class="inline-block divButAction"><a class="butAction" id="btnhideclosedlines" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=hideclosedlines">'.$langs->trans("HideClosedServices").'</a></div>'; if ($action == 'showclosedlines') print '<div class="inline-block divButAction"><a class="butAction" id="btnhideclosedlines" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=hideclosedlines">'.$langs->trans("HideClosedServices").'</a></div>';
else print '<div class="inline-block divButAction"><a class="butAction" id="btnshowclosedlines" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=showclosedlines">'.$langs->trans("ShowClosedServices").'</a></div>'; else print '<div class="inline-block divButAction"><a class="butAction" id="btnshowclosedlines" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=showclosedlines">'.$langs->trans("ShowClosedServices").'</a></div>';

View File

@ -245,30 +245,30 @@ if ($search_contract) $sql .= " AND c.ref LIKE '%".$db->escape($search_contract)
if ($search_service) $sql .= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')"; if ($search_service) $sql .= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')";
if ($socid > 0) $sql .= " AND s.rowid = ".$socid; if ($socid > 0) $sql .= " AND s.rowid = ".$socid;
$filter_dateouvertureprevue_start=dol_mktime(0, 0, 0, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear); $filter_dateouvertureprevue_start = dol_mktime(0, 0, 0, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear);
$filter_dateouvertureprevue_end=dol_mktime(23, 59, 59, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear); $filter_dateouvertureprevue_end = dol_mktime(23, 59, 59, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear);
if ($filter_dateouvertureprevue_start != '' && $filter_opouvertureprevue == -1) $filter_opouvertureprevue = ' BETWEEN '; if ($filter_dateouvertureprevue_start != '' && $filter_opouvertureprevue == -1) $filter_opouvertureprevue = ' BETWEEN ';
$filter_date1_start =dol_mktime(0, 0, 0, $op1month, $op1day, $op1year); $filter_date1_start = dol_mktime(0, 0, 0, $op1month, $op1day, $op1year);
$filter_date1_end =dol_mktime(23, 59, 59, $op1month, $op1day, $op1year); $filter_date1_end = dol_mktime(23, 59, 59, $op1month, $op1day, $op1year);
if ($filter_date1_start != '' && $filter_op1 == -1) $filter_op1 = ' BETWEEN '; if ($filter_date1_start != '' && $filter_op1 == -1) $filter_op1 = ' BETWEEN ';
$filter_date2_start=dol_mktime(0, 0, 0, $op2month, $op2day, $op2year); $filter_date2_start = dol_mktime(0, 0, 0, $op2month, $op2day, $op2year);
$filter_date2_end=dol_mktime(23, 59, 59, $op2month, $op2day, $op2year); $filter_date2_end = dol_mktime(23, 59, 59, $op2month, $op2day, $op2year);
if ($filter_date2_start != '' && $filter_op2 == -1) $filter_op2 = ' BETWEEN '; if ($filter_date2_start != '' && $filter_op2 == -1) $filter_op2 = ' BETWEEN ';
$filter_datecloture_start=dol_mktime(0, 0, 0, $opcloturemonth, $opclotureday, $opclotureyear); $filter_datecloture_start = dol_mktime(0, 0, 0, $opcloturemonth, $opclotureday, $opclotureyear);
$filter_datecloture_end=dol_mktime(23, 59, 59, $opcloturemonth, $opclotureday, $opclotureyear); $filter_datecloture_end = dol_mktime(23, 59, 59, $opcloturemonth, $opclotureday, $opclotureyear);
if ($filter_datecloture_start != '' && $filter_opcloture == -1) $filter_opcloture = ' BETWEEN '; if ($filter_datecloture_start != '' && $filter_opcloture == -1) $filter_opcloture = ' BETWEEN ';
if (! empty($filter_opouvertureprevue) && $filter_opouvertureprevue != -1 && $filter_opouvertureprevue != ' BETWEEN ' && $filter_dateouvertureprevue_start != '') $sql.= " AND cd.date_ouverture_prevue ".$filter_opouvertureprevue." '".$db->idate($filter_dateouvertureprevue_start)."'"; if (!empty($filter_opouvertureprevue) && $filter_opouvertureprevue != -1 && $filter_opouvertureprevue != ' BETWEEN ' && $filter_dateouvertureprevue_start != '') $sql .= " AND cd.date_ouverture_prevue ".$filter_opouvertureprevue." '".$db->idate($filter_dateouvertureprevue_start)."'";
if (! empty($filter_opouvertureprevue) && $filter_opouvertureprevue == ' BETWEEN ') $sql.= " AND '".$db->idate($filter_dateouvertureprevue_end)."'"; if (!empty($filter_opouvertureprevue) && $filter_opouvertureprevue == ' BETWEEN ') $sql .= " AND '".$db->idate($filter_dateouvertureprevue_end)."'";
if (! empty($filter_op1) && $filter_op1 != -1 && $filter_op1 != ' BETWEEN ' && $filter_date1_start != '') $sql.= " AND cd.date_ouverture ".$filter_op1." '".$db->idate($filter_date1_start)."'"; if (!empty($filter_op1) && $filter_op1 != -1 && $filter_op1 != ' BETWEEN ' && $filter_date1_start != '') $sql .= " AND cd.date_ouverture ".$filter_op1." '".$db->idate($filter_date1_start)."'";
if (! empty($filter_op1) && $filter_op1==' BETWEEN ') $sql.= " AND '".$db->idate($filter_date1_end)."'"; if (!empty($filter_op1) && $filter_op1 == ' BETWEEN ') $sql .= " AND '".$db->idate($filter_date1_end)."'";
if (! empty($filter_op2) && $filter_op2 != -1 && $filter_op2 != ' BETWEEN ' && $filter_date2_start != '') $sql.= " AND cd.date_fin_validite ".$filter_op2." '".$db->idate($filter_date2_start)."'"; if (!empty($filter_op2) && $filter_op2 != -1 && $filter_op2 != ' BETWEEN ' && $filter_date2_start != '') $sql .= " AND cd.date_fin_validite ".$filter_op2." '".$db->idate($filter_date2_start)."'";
if (! empty($filter_op2) && $filter_op2==' BETWEEN ') $sql.= " AND '".$db->idate($filter_date2_end)."'"; if (!empty($filter_op2) && $filter_op2 == ' BETWEEN ') $sql .= " AND '".$db->idate($filter_date2_end)."'";
if (! empty($filter_opcloture) && $filter_opcloture != ' BETWEEN ' && $filter_opcloture != -1 && $filter_datecloture_start != '') $sql.= " AND cd.date_cloture ".$filter_opcloture." '".$db->idate($filter_datecloture_start)."'"; if (!empty($filter_opcloture) && $filter_opcloture != ' BETWEEN ' && $filter_opcloture != -1 && $filter_datecloture_start != '') $sql .= " AND cd.date_cloture ".$filter_opcloture." '".$db->idate($filter_datecloture_start)."'";
if (! empty($filter_opcloture) && $filter_opcloture==' BETWEEN ') $sql.= " AND '".$db->idate($filter_datecloture_end)."'"; if (!empty($filter_opcloture) && $filter_opcloture == ' BETWEEN ') $sql .= " AND '".$db->idate($filter_datecloture_end)."'";
// Add where from extra fields // Add where from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
$sql .= $db->order($sortfield, $sortorder); $sql .= $db->order($sortfield, $sortorder);

View File

@ -192,7 +192,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
{ {
// $upload_dir ends with a slash, so be must be sure the medias dir to compare to ends with slash too. // $upload_dir ends with a slash, so be must be sure the medias dir to compare to ends with slash too.
$publicmediasdirwithslash = $conf->medias->multidir_output[$conf->entity]; $publicmediasdirwithslash = $conf->medias->multidir_output[$conf->entity];
if (! preg_match('/\/$/', $publicmediasdirwithslash)) $publicmediasdirwithslash.='/'; if (!preg_match('/\/$/', $publicmediasdirwithslash)) $publicmediasdirwithslash .= '/';
if (strpos($upload_dir, $publicmediasdirwithslash) !== 0) { // We never add .noexe on files into media directory if (strpos($upload_dir, $publicmediasdirwithslash) !== 0) { // We never add .noexe on files into media directory
$filenameto .= '.noexe'; $filenameto .= '.noexe';

View File

@ -33,7 +33,7 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel',
if (empty($action) || !is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before'); if (empty($action) || !is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before');
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
$result_update = $object->update_note(dol_html_entity_decode(GETPOST('note_public', 'restricthtml'), ENT_QUOTES|ENT_HTML5, 'UTF-8', 1), '_public'); $result_update = $object->update_note(dol_html_entity_decode(GETPOST('note_public', 'restricthtml'), ENT_QUOTES | ENT_HTML5, 'UTF-8', 1), '_public');
if ($result_update < 0) setEventMessages($object->error, $object->errors, 'errors'); if ($result_update < 0) setEventMessages($object->error, $object->errors, 'errors');
elseif (in_array($object->table_element, array('supplier_proposal', 'propal', 'commande_fournisseur', 'commande', 'facture_fourn', 'facture'))) elseif (in_array($object->table_element, array('supplier_proposal', 'propal', 'commande_fournisseur', 'commande', 'facture_fourn', 'facture')))
@ -63,6 +63,6 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel',
// Set public note // Set public note
if (empty($action) || !is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before'); if (empty($action) || !is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before');
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
$result = $object->update_note(dol_html_entity_decode(GETPOST('note_private', 'restricthtml'), ENT_QUOTES|ENT_HTML5), '_private'); $result = $object->update_note(dol_html_entity_decode(GETPOST('note_private', 'restricthtml'), ENT_QUOTES | ENT_HTML5), '_private');
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
} }

View File

@ -47,7 +47,7 @@ if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
require '../../main.inc.php'; require '../../main.inc.php';
//$time = (int) GETPOST('time', 'int'); // Use the time parameter that is always increased by time_update, even if call is late //$time = (int) GETPOST('time', 'int'); // Use the time parameter that is always increased by time_update, even if call is late
$time=dol_now(); $time = dol_now();
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$listofreminderids = GETPOST('listofreminderids', 'aZ09'); $listofreminderids = GETPOST('listofreminderids', 'aZ09');

View File

@ -110,11 +110,11 @@ if (!empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARC
{ {
$arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
} }
if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) || ! empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire)
{ {
$arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); $arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
} }
if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || ! empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
{ {
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
} }
@ -131,7 +131,7 @@ if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUST
} }
// Vendor payments // Vendor payments
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || ! empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
{ {
$arrayresult['searchintovendorpayments'] = array( $arrayresult['searchintovendorpayments'] = array(
'position'=>175, 'position'=>175,

View File

@ -22,7 +22,7 @@
* \brief This file is a sample box definition file * \brief This file is a sample box definition file
* Put some comments here * Put some comments here
*/ */
include_once DOL_DOCUMENT_ROOT . "/core/boxes/modules_boxes.php"; include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
/** /**
* Class to manage the box * Class to manage the box

View File

@ -294,13 +294,13 @@ class CMailFile
$addr_bcc .= ($addr_bcc ? ', ' : '').$conf->global->MAIN_MAIL_AUTOCOPY_TO; $addr_bcc .= ($addr_bcc ? ', ' : '').$conf->global->MAIN_MAIL_AUTOCOPY_TO;
} }
$keyforsslseflsigned ='MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED'; $keyforsslseflsigned = 'MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED';
if (!empty($this->sendcontext)) { if (!empty($this->sendcontext)) {
$smtpContextKey = strtoupper($this->sendcontext); $smtpContextKey = strtoupper($this->sendcontext);
$keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_' . $smtpContextKey; $keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_'.$smtpContextKey;
$smtpContextSendMode = $conf->global->{$keyForSMTPSendMode}; $smtpContextSendMode = $conf->global->{$keyForSMTPSendMode};
if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') { if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') {
$keyforsslseflsigned ='MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_' . $smtpContextKey; $keyforsslseflsigned = 'MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_'.$smtpContextKey;
} }
} }
@ -653,19 +653,19 @@ class CMailFile
$keyforsmtppw = 'MAIN_MAIL_SMTPS_PW'; $keyforsmtppw = 'MAIN_MAIL_SMTPS_PW';
$keyfortls = 'MAIN_MAIL_EMAIL_TLS'; $keyfortls = 'MAIN_MAIL_EMAIL_TLS';
$keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS'; $keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS';
$keyforsslseflsigned ='MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED'; $keyforsslseflsigned = 'MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED';
if (!empty($this->sendcontext)) { if (!empty($this->sendcontext)) {
$smtpContextKey = strtoupper($this->sendcontext); $smtpContextKey = strtoupper($this->sendcontext);
$keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_'.$smtpContextKey; $keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_'.$smtpContextKey;
$smtpContextSendMode = $conf->global->{$keyForSMTPSendMode}; $smtpContextSendMode = $conf->global->{$keyForSMTPSendMode};
if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') { if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') {
$keyforsmtpserver = 'MAIN_MAIL_SMTP_SERVER_' . $smtpContextKey; $keyforsmtpserver = 'MAIN_MAIL_SMTP_SERVER_'.$smtpContextKey;
$keyforsmtpport = 'MAIN_MAIL_SMTP_PORT_' . $smtpContextKey; $keyforsmtpport = 'MAIN_MAIL_SMTP_PORT_'.$smtpContextKey;
$keyforsmtpid = 'MAIN_MAIL_SMTPS_ID_' . $smtpContextKey; $keyforsmtpid = 'MAIN_MAIL_SMTPS_ID_'.$smtpContextKey;
$keyforsmtppw = 'MAIN_MAIL_SMTPS_PW_' . $smtpContextKey; $keyforsmtppw = 'MAIN_MAIL_SMTPS_PW_'.$smtpContextKey;
$keyfortls = 'MAIN_MAIL_EMAIL_TLS_' . $smtpContextKey; $keyfortls = 'MAIN_MAIL_EMAIL_TLS_'.$smtpContextKey;
$keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS_' . $smtpContextKey; $keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS_'.$smtpContextKey;
$keyforsslseflsigned ='MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_' . $smtpContextKey; $keyforsslseflsigned = 'MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_'.$smtpContextKey;
} }
} }

View File

@ -297,7 +297,7 @@ abstract class CommonInvoice extends CommonObject
$table2 = 'paiement'; $table2 = 'paiement';
$field = 'fk_facture'; $field = 'fk_facture';
$field2 = 'fk_paiement'; $field2 = 'fk_paiement';
$field3=', p.ref_ext'; $field3 = ', p.ref_ext';
$sharedentity = 'facture'; $sharedentity = 'facture';
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier')
{ {
@ -305,7 +305,7 @@ abstract class CommonInvoice extends CommonObject
$table2 = 'paiementfourn'; $table2 = 'paiementfourn';
$field = 'fk_facturefourn'; $field = 'fk_facturefourn';
$field2 = 'fk_paiementfourn'; $field2 = 'fk_paiementfourn';
$field3=''; $field3 = '';
$sharedentity = 'facture_fourn'; $sharedentity = 'facture_fourn';
} }
@ -327,11 +327,11 @@ abstract class CommonInvoice extends CommonObject
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$tmp = array('amount'=>$obj->amount,'type'=>$obj->code, 'date'=>$obj->datep, 'num'=>$obj->num, 'ref'=>$obj->ref); $tmp = array('amount'=>$obj->amount, 'type'=>$obj->code, 'date'=>$obj->datep, 'num'=>$obj->num, 'ref'=>$obj->ref);
if (!empty($field3)) { if (!empty($field3)) {
$tmp['ref_ext'] = $obj->ref_ext; $tmp['ref_ext'] = $obj->ref_ext;
} }
$retarray[]=$tmp; $retarray[] = $tmp;
$i++; $i++;
} }
$this->db->free($resql); $this->db->free($resql);

View File

@ -12,7 +12,7 @@
* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr> * Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
* Copyright (C) 2017-2019 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2017-2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com> * Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat> * Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -334,6 +334,13 @@ abstract class CommonObject
*/ */
public $last_main_doc; public $last_main_doc;
/**
* @var int Bank account ID
* @deprecated
* @see $fk_account
*/
public $fk_bank;
/** /**
* @var int Bank account ID * @var int Bank account ID
* @see SetBankAccount() * @see SetBankAccount()
@ -437,6 +444,11 @@ abstract class CommonObject
public $next_prev_filter; public $next_prev_filter;
/**
* @var int 1 if object is specimen
*/
public $specimen = 0;
/** /**
* @var array List of child tables. To test if we can delete object. * @var array List of child tables. To test if we can delete object.
*/ */
@ -2245,12 +2257,12 @@ abstract class CommonObject
return 1; return 1;
} else { } else {
dol_syslog(get_class($this).'::setTransportMode Error '.$sql.' - '.$this->db->error()); dol_syslog(get_class($this).'::setTransportMode Error '.$sql.' - '.$this->db->error());
$this->error=$this->db->error(); $this->error = $this->db->error();
return -1; return -1;
} }
} else { } else {
dol_syslog(get_class($this).'::setTransportMode, status of the object is incompatible'); dol_syslog(get_class($this).'::setTransportMode, status of the object is incompatible');
$this->error='Status of the object is incompatible '.$this->statut; $this->error = 'Status of the object is incompatible '.$this->statut;
return -2; return -2;
} }
} }
@ -6306,7 +6318,8 @@ abstract class CommonObject
$param_list = array_keys($param['options']); // $param_list='ObjectName:classPath[:AddCreateButtonOrNot[:Filter]]' $param_list = array_keys($param['options']); // $param_list='ObjectName:classPath[:AddCreateButtonOrNot[:Filter]]'
$param_list_array = explode(':', $param_list[0]); $param_list_array = explode(':', $param_list[0]);
$showempty = (($required && $default != '') ? 0 : 1); $showempty = (($required && $default != '') ? 0 : 1);
if (!empty($param_list_array[2])) { // If the entry into $fields is set to add a create button
if (!preg_match('/search_/', $keyprefix) && !empty($param_list_array[2])) { // If the entry into $fields is set to add a create button
$morecss .= ' widthcentpercentminusx'; $morecss .= ' widthcentpercentminusx';
} }
@ -8462,7 +8475,7 @@ abstract class CommonObject
$this->db->begin(); $this->db->begin();
switch ($this->element){ switch ($this->element) {
case 'propal': case 'propal':
$element = 'propale'; $element = 'propale';
break; break;
@ -8470,10 +8483,10 @@ abstract class CommonObject
$element = 'produit'; $element = 'produit';
break; break;
case 'order_supplier': case 'order_supplier':
$element ='fournisseur/commande'; $element = 'fournisseur/commande';
break; break;
case 'invoice_supplier': case 'invoice_supplier':
$element = 'fournisseur/facture/' . get_exdir($this->id, 2, 0, 1, $this, 'invoice_supplier'); $element = 'fournisseur/facture/'.get_exdir($this->id, 2, 0, 1, $this, 'invoice_supplier');
break; break;
case 'shipping': case 'shipping':
$element = 'expedition/sending'; $element = 'expedition/sending';
@ -8483,8 +8496,8 @@ abstract class CommonObject
} }
$sql = "DELETE FROM ".MAIN_DB_PREFIX."ecm_files"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."ecm_files";
$sql.= " WHERE filename LIKE '".$this->db->escape($this->ref)."%'"; $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%'";
$sql.= " AND filepath = '".$this->db->escape($element)."/".$this->db->escape($this->ref)."' AND entity = ".$conf->entity; $sql .= " AND filepath = '".$this->db->escape($element)."/".$this->db->escape($this->ref)."' AND entity = ".$conf->entity;
if (!$this->db->query($sql)) { if (!$this->db->query($sql)) {
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();

View File

@ -331,7 +331,7 @@ class CProductNature // extends CommonObject
{ {
if ($mode == 'label') { if ($mode == 'label') {
return dol_getIdFromCode($this->db, $code, $this->table_element, 'label', 'code'); return dol_getIdFromCode($this->db, $code, $this->table_element, 'label', 'code');
} elseif ($mode == 'code'){ } elseif ($mode == 'code') {
return dol_getIdFromCode($this->db, $code, $this->table_element, 'code', 'code'); return dol_getIdFromCode($this->db, $code, $this->table_element, 'code', 'code');
} }

View File

@ -386,9 +386,9 @@ class CUnits // extends CommonObject
public function getUnitFromCode($code, $mode = 'code') public function getUnitFromCode($code, $mode = 'code')
{ {
if ($mode == 'short_label'){ if ($mode == 'short_label') {
return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid'); return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid');
} elseif ($mode == 'code'){ } elseif ($mode == 'code') {
return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid'); return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid');
} }
@ -412,7 +412,7 @@ class CUnits // extends CommonObject
// convert to standard unit // convert to standard unit
$value = $value * $scaleUnitPow; $value = $value * $scaleUnitPow;
if ($fk_new_unit !=0 ){ if ($fk_new_unit != 0) {
// Calcul en unité de base // Calcul en unité de base
$scaleUnitPow = $this->scaleOfUnitPow($fk_new_unit); $scaleUnitPow = $this->scaleOfUnitPow($fk_new_unit);
if (!empty($scaleUnitPow)) if (!empty($scaleUnitPow))

View File

@ -793,10 +793,10 @@ class dolReceiptPrinter extends Printer
$row = $this->db->fetch_object($resql); $row = $this->db->fetch_object($resql);
$spacestoadd = $nbcharactbyline - strlen($langs->transnoentitiesnoconv("PaymentTypeShort".$row->code)) - 12; $spacestoadd = $nbcharactbyline - strlen($langs->transnoentitiesnoconv("PaymentTypeShort".$row->code)) - 12;
$spaces = str_repeat(' ', $spacestoadd); $spaces = str_repeat(' ', $spacestoadd);
$amount_payment=($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount; $amount_payment = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
if ($row->code == "LIQ") $amount_payment = $amount_payment + $row->pos_change; // Show amount with excess received if is cash payment if ($row->code == "LIQ") $amount_payment = $amount_payment + $row->pos_change; // Show amount with excess received if is cash payment
$this->printer->text($spaces.$langs->transnoentitiesnoconv("PaymentTypeShort".$row->code).' '.str_pad(price($amount_payment), 10, ' ', STR_PAD_LEFT)."\n"); $this->printer->text($spaces.$langs->transnoentitiesnoconv("PaymentTypeShort".$row->code).' '.str_pad(price($amount_payment), 10, ' ', STR_PAD_LEFT)."\n");
if ($row->code == "LIQ" && $row->pos_change>0) // Print change only in cash payments if ($row->code == "LIQ" && $row->pos_change > 0) // Print change only in cash payments
{ {
$spacestoadd = $nbcharactbyline - strlen($langs->trans("Change")) - 12; $spacestoadd = $nbcharactbyline - strlen($langs->trans("Change")) - 12;
$spaces = str_repeat(' ', $spacestoadd); $spaces = str_repeat(' ', $spacestoadd);

View File

@ -1187,12 +1187,12 @@ class Form
// We search companies // We search companies
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.fournisseur, s.code_client, s.code_fournisseur"; $sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
if (! empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) {
$sql .= ", s.address, s.zip, s.town"; $sql .= ", s.address, s.zip, s.town";
$sql .= ", dictp.code as country_code"; $sql .= ", dictp.code as country_code";
} }
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
if (! empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as dictp ON dictp.rowid = s.fk_pays"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as dictp ON dictp.rowid = s.fk_pays";
} }
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -1283,7 +1283,7 @@ class Form
if ($obj->client || $obj->fournisseur) $label .= ')'; if ($obj->client || $obj->fournisseur) $label .= ')';
} }
if (! empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) {
$label .= ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); $label .= ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
if (!empty($obj->country_code)) { if (!empty($obj->country_code)) {
$label .= ', '.$langs->trans('Country'.$obj->country_code); $label .= ', '.$langs->trans('Country'.$obj->country_code);
@ -5048,9 +5048,11 @@ class Form
* @param string $selected preselected currency code * @param string $selected preselected currency code
* @param string $htmlname name of HTML select list * @param string $htmlname name of HTML select list
* @param integer $useempty 1=Add empty line * @param integer $useempty 1=Add empty line
* @param string $filter Optional filters criteras (example: 'code <> x', ' in (1,3)')
* @param bool $excludeConfCurrency false = If company current currency not in table, we add it into list. Should always be available. true = we are in currency_rate update , we don't want to see conf->currency in select
* @return string * @return string
*/ */
public function selectMultiCurrency($selected = '', $htmlname = 'multicurrency_code', $useempty = 0) public function selectMultiCurrency($selected = '', $htmlname = 'multicurrency_code', $useempty = 0, $filter = '', $excludeConfCurrency = false)
{ {
global $db, $conf, $langs, $user; global $db, $conf, $langs, $user;
@ -5060,6 +5062,7 @@ class Form
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'multicurrency'; $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'multicurrency';
$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; $sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
if ($filter) $sql .= " AND ".$filter;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -5070,7 +5073,7 @@ class Form
$out .= '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">'; $out .= '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
if ($useempty) $out .= '<option value="">&nbsp;</option>'; if ($useempty) $out .= '<option value="">&nbsp;</option>';
// If company current currency not in table, we add it into list. Should always be available. // If company current currency not in table, we add it into list. Should always be available.
if (!in_array($conf->currency, $TCurrency)) if (!in_array($conf->currency, $TCurrency) && !$excludeConfCurrency)
{ {
$TCurrency[$conf->currency] = $conf->currency; $TCurrency[$conf->currency] = $conf->currency;
} }
@ -5647,7 +5650,7 @@ class Form
if ($d && $h) { if ($d && $h) {
$retstring .= ($h == 2 ? '<br>' : ' '); $retstring .= ($h == 2 ? '<br>' : ' ');
$retstring.='<span class="nowraponall">'; $retstring .= '<span class="nowraponall">';
} }
if ($h) if ($h)
@ -6619,7 +6622,7 @@ class Form
templateSelection: formatSelection /* For 4.0 */ templateSelection: formatSelection /* For 4.0 */
}); });
});'."\n"; });'."\n";
} elseif ($addjscombo == 2 && ! defined('DISABLE_MULTISELECT')) } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT'))
{ {
// Add other js lib // Add other js lib
// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin

View File

@ -186,13 +186,13 @@ class FormCompany extends Form
{ {
global $user, $langs; global $user, $langs;
print '<form method="post" action="' . $page . '">'; print '<form method="post" action="'.$page.'">';
print '<input type="hidden" name="action" value="setprospectcontactlevel">'; print '<input type="hidden" name="action" value="setprospectcontactlevel">';
print '<input type="hidden" name="token" value="' . newToken() . '">'; print '<input type="hidden" name="token" value="'.newToken().'">';
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
$sql = "SELECT code, label"; $sql = "SELECT code, label";
$sql .= " FROM " . MAIN_DB_PREFIX . "c_prospectcontactlevel"; $sql .= " FROM ".MAIN_DB_PREFIX."c_prospectcontactlevel";
$sql .= " WHERE active > 0"; $sql .= " WHERE active > 0";
$sql .= " ORDER BY sortorder"; $sql .= " ORDER BY sortorder";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
@ -220,8 +220,8 @@ class FormCompany extends Form
print Form::selectarray($htmlname, $options, $selected); print Form::selectarray($htmlname, $options, $selected);
} }
else dol_print_error($this->db); else dol_print_error($this->db);
if (!empty($htmlname) && $user->admin) print ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); if (!empty($htmlname) && $user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
print '</form>'; print '</form>';
} }

View File

@ -1203,7 +1203,7 @@ class FormFile
{ {
print '</a>'; print '</a>';
$section_dir = dirname(GETPOST('urlfile', 'alpha')); $section_dir = dirname(GETPOST('urlfile', 'alpha'));
if (! preg_match('/\/$/', $section_dir)) $section_dir.='/'; if (!preg_match('/\/$/', $section_dir)) $section_dir .= '/';
print '<input type="hidden" name="section_dir" value="'.$section_dir.'">'; print '<input type="hidden" name="section_dir" value="'.$section_dir.'">';
print '<input type="hidden" name="renamefilefrom" value="'.dol_escape_htmltag($file['name']).'">'; print '<input type="hidden" name="renamefilefrom" value="'.dol_escape_htmltag($file['name']).'">';
print '<input type="text" name="renamefileto" class="quatrevingtpercent" value="'.dol_escape_htmltag($file['name']).'">'; print '<input type="text" name="renamefileto" class="quatrevingtpercent" value="'.dol_escape_htmltag($file['name']).'">';
@ -1303,7 +1303,7 @@ class FormFile
if ($useinecm == 1 || $useinecm == 5) // ECM manual tree only if ($useinecm == 1 || $useinecm == 5) // ECM manual tree only
{ {
// $section is inside $param // $section is inside $param
$newparam.=preg_replace('/&file=.*$/', '', $param); // We don't need param file= $newparam .= preg_replace('/&file=.*$/', '', $param); // We don't need param file=
$backtopage = DOL_URL_ROOT.'/ecm/index.php?&section_dir='.urlencode($relativepath).$newparam; $backtopage = DOL_URL_ROOT.'/ecm/index.php?&section_dir='.urlencode($relativepath).$newparam;
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/ecm/file_card.php?urlfile='.urlencode($file['name']).$param.'&backtopage='.urlencode($backtopage).'" class="editfilelink" rel="'.urlencode($file['name']).'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>'; print '<a class="editfielda" href="'.DOL_URL_ROOT.'/ecm/file_card.php?urlfile='.urlencode($file['name']).$param.'&backtopage='.urlencode($backtopage).'" class="editfilelink" rel="'.urlencode($file['name']).'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
} }

View File

@ -567,7 +567,7 @@ class Ldap
if (!$olddn || $olddn != $dn) if (!$olddn || $olddn != $dn)
{ {
if (! empty($olddn) && ! empty($newrdn) && ! empty($newparent) && $this->ldapProtocolVersion === '3') if (!empty($olddn) && !empty($newrdn) && !empty($newparent) && $this->ldapProtocolVersion === '3')
{ {
// This function currently only works with LDAPv3 // This function currently only works with LDAPv3
$result = $this->rename($olddn, $newrdn, $newparent, $user, true); $result = $this->rename($olddn, $newrdn, $newparent, $user, true);

View File

@ -413,31 +413,31 @@ class Notify
switch ($notifcode) { switch ($notifcode) {
case 'BILL_VALIDATE': case 'BILL_VALIDATE':
$link = '<a href="' . $urlwithroot . '/compta/facture/card.php?facid=' . $object->id . '">' . $newref . '</a>'; $link = '<a href="'.$urlwithroot.'/compta/facture/card.php?facid='.$object->id.'">'.$newref.'</a>';
$dir_output = $conf->facture->dir_output; $dir_output = $conf->facture->dir_output;
$object_type = 'facture'; $object_type = 'facture';
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoiceValidated", $link); $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoiceValidated", $link);
break; break;
case 'BILL_PAYED': case 'BILL_PAYED':
$link ='<a href="' . $urlwithroot . '/compta/facture/card.php?facid='.$object->id . '">' . $newref . '</a>'; $link = '<a href="'.$urlwithroot.'/compta/facture/card.php?facid='.$object->id.'">'.$newref.'</a>';
$dir_output = $conf->facture->dir_output; $dir_output = $conf->facture->dir_output;
$object_type = 'facture'; $object_type = 'facture';
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoicePayed", $link); $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoicePayed", $link);
break; break;
case 'ORDER_VALIDATE': case 'ORDER_VALIDATE':
$link = '<a href="' . $urlwithroot . '/commande/card.php?id='.$object->id . '">' . $newref . '</a>'; $link = '<a href="'.$urlwithroot.'/commande/card.php?id='.$object->id.'">'.$newref.'</a>';
$dir_output = $conf->commande->dir_output; $dir_output = $conf->commande->dir_output;
$object_type = 'order'; $object_type = 'order';
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextOrderValidated", $link); $mesg = $outputlangs->transnoentitiesnoconv("EMailTextOrderValidated", $link);
break; break;
case 'PROPAL_VALIDATE': case 'PROPAL_VALIDATE':
$link = '<a href="' . $urlwithroot . '/comm/propal/card.php?id='.$object->id . '">' . $newref . '</a>'; $link = '<a href="'.$urlwithroot.'/comm/propal/card.php?id='.$object->id.'">'.$newref.'</a>';
$dir_output = $conf->propal->multidir_output[$object->entity]; $dir_output = $conf->propal->multidir_output[$object->entity];
$object_type = 'propal'; $object_type = 'propal';
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalValidated", $link); $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalValidated", $link);
break; break;
case 'PROPAL_CLOSE_SIGNED': case 'PROPAL_CLOSE_SIGNED':
$link = '<a href="' . $urlwithroot . '/comm/propal/card.php?id='.$object->id . '">' . $newref . '</a>'; $link = '<a href="'.$urlwithroot.'/comm/propal/card.php?id='.$object->id.'">'.$newref.'</a>';
$dir_output = $conf->propal->multidir_output[$object->entity]; $dir_output = $conf->propal->multidir_output[$object->entity];
$object_type = 'propal'; $object_type = 'propal';
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalClosedSigned", $link); $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalClosedSigned", $link);
@ -471,7 +471,7 @@ class Notify
$mesg .= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; $mesg .= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n";
break; break;
case 'ORDER_SUPPLIER_REFUSE': case 'ORDER_SUPPLIER_REFUSE':
$link = '<a href="' . $urlwithroot . '/fourn/commande/card.php?id='.$object->id . '">' . $newref . '</a>'; $link = '<a href="'.$urlwithroot.'/fourn/commande/card.php?id='.$object->id.'">'.$newref.'</a>';
$dir_output = $conf->fournisseur->commande->dir_output; $dir_output = $conf->fournisseur->commande->dir_output;
$object_type = 'order_supplier'; $object_type = 'order_supplier';
$mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n";

View File

@ -254,7 +254,7 @@ class RssParser
libxml_use_internal_errors(false); libxml_use_internal_errors(false);
$rss = simplexml_load_string($str, "SimpleXMLElement", LIBXML_NOCDATA); $rss = simplexml_load_string($str, "SimpleXMLElement", LIBXML_NOCDATA);
} else { } else {
if (! function_exists('xml_parser_create')) { if (!function_exists('xml_parser_create')) {
$this->error = 'Function xml_parser_create are not supported by your PHP'; $this->error = 'Function xml_parser_create are not supported by your PHP';
return -1; return -1;
} }

View File

@ -456,7 +456,7 @@ class SMTPs
$host = preg_replace('@ssl://@i', '', $host); // Remove prefix $host = preg_replace('@ssl://@i', '', $host); // Remove prefix
$host = preg_replace('@tls://@i', '', $host); // Remove prefix $host = preg_replace('@tls://@i', '', $host); // Remove prefix
if ($usetls && ! empty($conf->global->MAIN_SMTPS_ADD_TLS_TO_HOST_FOR_HELO)) $host = 'tls://'.$host; if ($usetls && !empty($conf->global->MAIN_SMTPS_ADD_TLS_TO_HOST_FOR_HELO)) $host = 'tls://'.$host;
$hosth = $host; $hosth = $host;

View File

@ -42,7 +42,6 @@ abstract class Stats
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
* @param int $startmonth month of the fiscal year start min 1 max 12 ; if 1 = january * @param int $startmonth month of the fiscal year start min 1 max 12 ; if 1 = january
* @return array Array of values * @return array Array of values
*/ */
public function getNbByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $format = 0, $startmonth = 1) public function getNbByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $format = 0, $startmonth = 1)
{ {

View File

@ -238,10 +238,10 @@ abstract class DoliDB implements Database
if (!empty($sortfield)) if (!empty($sortfield))
{ {
$oldsortorder = ''; $oldsortorder = '';
$return=''; $return = '';
$fields=explode(',', $sortfield); $fields = explode(',', $sortfield);
$orders=explode(',', $sortorder); $orders = explode(',', $sortorder);
$i=0; $i = 0;
foreach ($fields as $val) { foreach ($fields as $val) {
if (!$return) $return .= ' ORDER BY '; if (!$return) $return .= ' ORDER BY ';
else $return .= ', '; else $return .= ', ';
@ -341,8 +341,8 @@ abstract class DoliDB implements Database
if ($res) if ($res)
{ {
$results = array(); $results = array();
if ($this->num_rows($res) > 0){ if ($this->num_rows($res) > 0) {
while ($obj = $this->fetch_object($res)){ while ($obj = $this->fetch_object($res)) {
$results[] = $obj; $results[] = $obj;
} }
} }

View File

@ -59,7 +59,7 @@ function FindBadUtf8($string)
$regex = '([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]'; $regex = '([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]';
$regex .= '|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2}|(.{1}))'; $regex .= '|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2}|(.{1}))';
$matches =array(); $matches = array();
while (preg_match('/'.$regex.'/S', $string, $matches)) { while (preg_match('/'.$regex.'/S', $string, $matches)) {
if (isset($matches[2])) { if (isset($matches[2])) {
return true; return true;

View File

@ -943,7 +943,6 @@ function monthArray($outputlangs, $short = 0)
} }
/** /**
* Return array of week numbers. * Return array of week numbers.
* *
* @param int $month Month number * @param int $month Month number
* @param int $year Year number * @param int $year Year number
@ -961,7 +960,6 @@ function getWeekNumbersOfMonth($month, $year)
} }
/** /**
* Return array of first day of weeks. * Return array of first day of weeks.
* *
* @param array $TWeek array of week numbers * @param array $TWeek array of week numbers
* @param int $year Year number * @param int $year Year number
@ -978,7 +976,6 @@ function getFirstDayOfEachWeek($TWeek, $year)
} }
/** /**
* Return array of last day of weeks. * Return array of last day of weeks.
* *
* @param array $TWeek array of week numbers * @param array $TWeek array of week numbers
* @param int $year Year number * @param int $year Year number
@ -994,7 +991,6 @@ function getLastDayOfEachWeek($TWeek, $year)
} }
/** /**
* Return week number. * Return week number.
* *
* @param int $day Day number * @param int $day Day number
* @param int $month Month number * @param int $month Month number

View File

@ -5662,17 +5662,18 @@ function picto_required()
* @param integer $removelinefeed 1=Replace all new lines by 1 space, 0=Only ending new lines are removed others are replaced with \n, 2=Ending new lines are removed but others are kept with a same number of \n than nb of <br> when there is both "...<br>\n..." * @param integer $removelinefeed 1=Replace all new lines by 1 space, 0=Only ending new lines are removed others are replaced with \n, 2=Ending new lines are removed but others are kept with a same number of \n than nb of <br> when there is both "...<br>\n..."
* @param string $pagecodeto Encoding of input/output string * @param string $pagecodeto Encoding of input/output string
* @param integer $strip_tags 0=Use internal strip, 1=Use strip_tags() php function (bugged when text contains a < char that is not for a html tag) * @param integer $strip_tags 0=Use internal strip, 1=Use strip_tags() php function (bugged when text contains a < char that is not for a html tag)
* @param integer $removedoublespaces Replace double space into one space
* @return string String cleaned * @return string String cleaned
* *
* @see dol_escape_htmltag() strip_tags() dol_string_onlythesehtmltags() dol_string_neverthesehtmltags(), dolStripPhpCode() * @see dol_escape_htmltag() strip_tags() dol_string_onlythesehtmltags() dol_string_neverthesehtmltags(), dolStripPhpCode()
*/ */
function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = 'UTF-8', $strip_tags = 0) function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = 'UTF-8', $strip_tags = 0, $removedoublespaces = 1)
{ {
if ($removelinefeed == 2) $stringtoclean = preg_replace('/<br[^>]*>(\n|\r)+/ims', '<br>', $stringtoclean); if ($removelinefeed == 2) $stringtoclean = preg_replace('/<br[^>]*>(\n|\r)+/ims', '<br>', $stringtoclean);
$temp = preg_replace('/<br[^>]*>/i', "\n", $stringtoclean); $temp = preg_replace('/<br[^>]*>/i', "\n", $stringtoclean);
// We remove entities BEFORE stripping (in case of a separator char is encoded and not the other, the strip will fails) // We remove entities BEFORE stripping (in case of a separator char is encoded and not the other, the strip will fails)
$temp = dol_html_entity_decode($temp, ENT_COMPAT|ENT_HTML5, $pagecodeto); $temp = dol_html_entity_decode($temp, ENT_COMPAT | ENT_HTML5, $pagecodeto);
if ($strip_tags) { if ($strip_tags) {
$temp = strip_tags($temp); $temp = strip_tags($temp);
@ -5685,14 +5686,17 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto =
// $temp after pass 2: 0000-021 // $temp after pass 2: 0000-021
} }
// Remove also CR LF $temp = dol_html_entity_decode($temp, ENT_COMPAT, $pagecodeto);
// Remove also carriage returns
if ($removelinefeed == 1) $temp = str_replace(array("\r\n", "\r", "\n"), " ", $temp); if ($removelinefeed == 1) $temp = str_replace(array("\r\n", "\r", "\n"), " ", $temp);
// and double spaces // And double quotes
while (strpos($temp, " ")) if ($removedoublespaces) {
{ while (strpos($temp, " ")) {
$temp = str_replace(" ", " ", $temp); $temp = str_replace(" ", " ", $temp);
} }
}
return trim($temp); return trim($temp);
} }
@ -5884,7 +5888,7 @@ function dol_htmlentitiesbr($stringtoencode, $nl2brmode = 0, $pagecodefrom = 'UT
*/ */
function dol_htmlentitiesbr_decode($stringtodecode, $pagecodeto = 'UTF-8') function dol_htmlentitiesbr_decode($stringtodecode, $pagecodeto = 'UTF-8')
{ {
$ret = dol_html_entity_decode($stringtodecode, ENT_COMPAT|ENT_HTML5, $pagecodeto); $ret = dol_html_entity_decode($stringtodecode, ENT_COMPAT | ENT_HTML5, $pagecodeto);
$ret = preg_replace('/'."\r\n".'<br(\s[\sa-zA-Z_="]*)?\/?>/i', "<br>", $ret); $ret = preg_replace('/'."\r\n".'<br(\s[\sa-zA-Z_="]*)?\/?>/i', "<br>", $ret);
$ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>'."\r\n".'/i', "\r\n", $ret); $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>'."\r\n".'/i', "\r\n", $ret);
$ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>'."\n".'/i', "\n", $ret); $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>'."\n".'/i', "\n", $ret);

View File

@ -66,7 +66,7 @@ function jsUnEscape($source)
$pos++; $pos++;
} }
} }
return dol_html_entity_decode($decodedStr, ENT_COMPAT|ENT_HTML5); return dol_html_entity_decode($decodedStr, ENT_COMPAT | ENT_HTML5);
} }
@ -2404,9 +2404,9 @@ function phpSyntaxError($code)
if (!defined("LF")) define("LF", "\n"); if (!defined("LF")) define("LF", "\n");
if (!defined("CRLF")) define("CRLF", "\r\n"); if (!defined("CRLF")) define("CRLF", "\r\n");
$braces=0; $braces = 0;
$inString=0; $inString = 0;
foreach (token_get_all('<?php ' . $code) as $token) { foreach (token_get_all('<?php '.$code) as $token) {
if (is_array($token)) { if (is_array($token)) {
switch ($token[0]) { switch ($token[0]) {
case T_CURLY_OPEN: case T_CURLY_OPEN:
@ -2455,7 +2455,7 @@ function phpSyntaxError($code)
$code[2] = (int) $code[2]; $code[2] = (int) $code[2];
$code = $code[2] <= $braces $code = $code[2] <= $braces
? array($code[1], $code[2]) ? array($code[1], $code[2])
: array('unexpected $end' . substr($code[1], 14), $braces); : array('unexpected $end'.substr($code[1], 14), $braces);
} else $code = array('syntax error', 0); } else $code = array('syntax error', 0);
} else { } else {
ob_end_clean(); ob_end_clean();

View File

@ -40,6 +40,11 @@ function multicurrencyAdminPrepareHead()
$head[$h][2] = 'settings'; $head[$h][2] = 'settings';
$h++; $h++;
$head[$h][0] = dol_buildpath("/multicurrency/multicurrency_rate.php", 1);
$head[$h][1] = $langs->trans("TabTitleMulticurrencyRate");
$head[$h][2] = 'ratelist';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'multicurrency'); complete_head_from_modules($conf, $langs, null, $head, $h, 'multicurrency');
complete_head_from_modules($conf, $langs, null, $head, $h, 'multicurrency', 'remove'); complete_head_from_modules($conf, $langs, null, $head, $h, 'multicurrency', 'remove');

View File

@ -1260,7 +1260,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
// Manage HTML entities description test because $prodser->description is store with htmlentities but $desc no // Manage HTML entities description test because $prodser->description is store with htmlentities but $desc no
$textwasmodified = false; $textwasmodified = false;
if (!empty($desc) && dol_textishtml($desc) && !empty($prodser->description) && dol_textishtml($prodser->description)) { if (!empty($desc) && dol_textishtml($desc) && !empty($prodser->description) && dol_textishtml($prodser->description)) {
$textwasmodified = (strpos(dol_html_entity_decode($desc, ENT_QUOTES|ENT_HTML5), dol_html_entity_decode($prodser->description, ENT_QUOTES|ENT_HTML5)) !== false); $textwasmodified = (strpos(dol_html_entity_decode($desc, ENT_QUOTES | ENT_HTML5), dol_html_entity_decode($prodser->description, ENT_QUOTES | ENT_HTML5)) !== false);
} else { } else {
$textwasmodified = ($desc == $prodser->description); $textwasmodified = ($desc == $prodser->description);
} }
@ -1279,7 +1279,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
// Description short of product line // Description short of product line
$libelleproduitservice = $label; $libelleproduitservice = $label;
if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) { if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) {
$libelleproduitservice = '<b>' . $libelleproduitservice . '</b>'; $libelleproduitservice = '<b>'.$libelleproduitservice.'</b>';
} }
// Description long of product line // Description long of product line

View File

@ -654,7 +654,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
// TextTitleLinkColor // TextTitleLinkColor
if ($foruserprofile) { if ($foruserprofile) {
} else { } else {
$default=(empty($colortexttitlelink) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colortexttitlelink))); $default = (empty($colortexttitlelink) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colortexttitlelink)));
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("BackgroundTableTitleTextlinkColor").'</td>'; print '<td>'.$langs->trans("BackgroundTableTitleTextlinkColor").'</td>';

View File

@ -554,7 +554,7 @@ function getStructuredData($type, $data = array())
"name": "'.dol_escape_json($data['name']).'", "name": "'.dol_escape_json($data['name']).'",
"operatingSystem": "'.dol_escape_json($data['os']).'", "operatingSystem": "'.dol_escape_json($data['os']).'",
"applicationCategory": "https://schema.org/'.$data['applicationCategory'].'",'; "applicationCategory": "https://schema.org/'.$data['applicationCategory'].'",';
if (! empty($data['ratingcount'])) { if (!empty($data['ratingcount'])) {
$ret .= ' $ret .= '
"aggregateRating": { "aggregateRating": {
"@type": "AggregateRating", "@type": "AggregateRating",
@ -594,11 +594,11 @@ function getStructuredData($type, $data = array())
$i = 0; $i = 0;
foreach ($mysoc->socialnetworks as $key => $value) { foreach ($mysoc->socialnetworks as $key => $value) {
if ($key == 'linkedin') { if ($key == 'linkedin') {
$ret.= '"https://www.'.$key.'.com/company/'.dol_escape_json($value).'"'; $ret .= '"https://www.'.$key.'.com/company/'.dol_escape_json($value).'"';
} elseif ($key == 'youtube') { } elseif ($key == 'youtube') {
$ret.= '"https://www.'.$key.'.com/user/'.dol_escape_json($value).'"'; $ret .= '"https://www.'.$key.'.com/user/'.dol_escape_json($value).'"';
} else { } else {
$ret.= '"https://www.'.$key.'.com/'.dol_escape_json($value).'"'; $ret .= '"https://www.'.$key.'.com/'.dol_escape_json($value).'"';
} }
$i++; $i++;
if ($i < count($mysoc->socialnetworks)) $ret .= ', '; if ($i < count($mysoc->socialnetworks)) $ret .= ', ';
@ -660,7 +660,7 @@ function getStructuredData($type, $data = array())
$i = 0; $i = 0;
$arrayofkeywords = explode(',', $websitepage->keywords); $arrayofkeywords = explode(',', $websitepage->keywords);
foreach ($arrayofkeywords as $keyword) { foreach ($arrayofkeywords as $keyword) {
$ret.= '"'.dol_escape_json($keyword).'"'; $ret .= '"'.dol_escape_json($keyword).'"';
$i++; $i++;
if ($i < count($arrayofkeywords)) $ret .= ', '; if ($i < count($arrayofkeywords)) $ret .= ', ';
} }
@ -849,7 +849,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so
if (!$error && (empty($max) || ($found < $max)) && (preg_match('/meta/', $algo) || preg_match('/content/', $algo))) if (!$error && (empty($max) || ($found < $max)) && (preg_match('/meta/', $algo) || preg_match('/content/', $algo)))
{ {
$sql = 'SELECT wp.rowid FROM '.MAIN_DB_PREFIX.'website_page as wp'; $sql = 'SELECT wp.rowid FROM '.MAIN_DB_PREFIX.'website_page as wp';
if (is_array($otherfilters) && ! empty($otherfilters['category'])) { if (is_array($otherfilters) && !empty($otherfilters['category'])) {
$sql .= ', '.MAIN_DB_PREFIX.'categorie_website_page as cwp'; $sql .= ', '.MAIN_DB_PREFIX.'categorie_website_page as cwp';
} }
$sql .= " WHERE wp.fk_website = ".$website->id; $sql .= " WHERE wp.fk_website = ".$website->id;
@ -879,7 +879,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so
$searchalgo .= ($searchalgo ? ' OR ' : '')."wp.content LIKE '%".$db->escape($searchstring)."%'"; $searchalgo .= ($searchalgo ? ' OR ' : '')."wp.content LIKE '%".$db->escape($searchstring)."%'";
} }
$sql .= $searchalgo; $sql .= $searchalgo;
if (is_array($otherfilters) && ! empty($otherfilters['category'])) { if (is_array($otherfilters) && !empty($otherfilters['category'])) {
$sql .= ' AND cwp.fk_website_page = wp.rowid AND cwp.fk_categorie = '.((int) $otherfilters['category']); $sql .= ' AND cwp.fk_website_page = wp.rowid AND cwp.fk_categorie = '.((int) $otherfilters['category']);
} }
$sql .= ")"; $sql .= ")";

View File

@ -353,7 +353,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'session' => (($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy") ? 0 : 1), 'session' => (($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy") ? 0 : 1),
'loadLangs' => array("compta", "accountancy", "assets","intracommreport"), 'loadLangs' => array("compta", "accountancy", "assets", "intracommreport"),
'submenus' => array(), 'submenus' => array(),
); );

View File

@ -219,32 +219,32 @@ class pdf_storm extends ModelePDFDeliveryOrder
// Loop on each lines to detect if there is at least one image to show // Loop on each lines to detect if there is at least one image to show
$realpatharray=array(); $realpatharray = array();
$this->atleastonephoto = false; $this->atleastonephoto = false;
if (! empty($conf->global->MAIN_GENERATE_DELIVERY_WITH_PICTURE)) if (!empty($conf->global->MAIN_GENERATE_DELIVERY_WITH_PICTURE))
{ {
$objphoto = new Product($this->db); $objphoto = new Product($this->db);
for ($i = 0 ; $i < $nblines ; $i++) for ($i = 0; $i < $nblines; $i++)
{ {
if (empty($object->lines[$i]->fk_product)) continue; if (empty($object->lines[$i]->fk_product)) continue;
$objphoto->fetch($object->lines[$i]->fk_product); $objphoto->fetch($object->lines[$i]->fk_product);
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
{ {
$pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product') . $objphoto->id ."/photos/"; $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
$pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product') . dol_sanitizeFileName($objphoto->ref).'/'; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
} }
else { else {
$pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product') . dol_sanitizeFileName($objphoto->ref).'/'; // default $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default
$pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product') . $objphoto->id ."/photos/"; // alternative $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative
} }
$arephoto = false; $arephoto = false;
foreach ($pdir as $midir) foreach ($pdir as $midir)
{ {
if (! $arephoto) if (!$arephoto)
{ {
$dir = $conf->product->dir_output.'/'.$midir; $dir = $conf->product->dir_output.'/'.$midir;
@ -254,14 +254,14 @@ class pdf_storm extends ModelePDFDeliveryOrder
{ {
if ($obj['photo_vignette']) if ($obj['photo_vignette'])
{ {
$filename= $obj['photo_vignette']; $filename = $obj['photo_vignette'];
} }
else { else {
$filename=$obj['photo']; $filename = $obj['photo'];
} }
} }
else { else {
$filename=$obj['photo']; $filename = $obj['photo'];
} }
$realpath = $dir.$filename; $realpath = $dir.$filename;
@ -271,7 +271,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
} }
} }
if ($realpath && $arephoto) $realpatharray[$i]=$realpath; if ($realpath && $arephoto) $realpatharray[$i] = $realpath;
} }
} }
@ -413,7 +413,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
for ($i = 0; $i < $nblines; $i++) for ($i = 0; $i < $nblines; $i++)
{ {
// Fetch optionals // Fetch optionals
if (empty($object->lines[$i]->array_options)){ if (empty($object->lines[$i]->array_options)) {
$object->lines[$i]->fetch_optionals(); $object->lines[$i]->fetch_optionals();
} }
@ -435,17 +435,17 @@ class pdf_storm extends ModelePDFDeliveryOrder
$showpricebeforepagebreak = 1; $showpricebeforepagebreak = 1;
$posYAfterImage=0; $posYAfterImage = 0;
$posYAfterDescription=0; $posYAfterDescription = 0;
if ($this->getColumnStatus('photo')) if ($this->getColumnStatus('photo'))
{ {
// We start with Photo of product line // We start with Photo of product line
if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur-($heightforfooter+$heightforfreetext+$heightforinfotot))) // If photo too high, we moved completely on new page if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) // If photo too high, we moved completely on new page
{ {
$pdf->AddPage('', '', true); $pdf->AddPage('', '', true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (!empty($tplidx)) $pdf->useTemplate($tplidx);
//if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); //if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pageposbefore+1); $pdf->setPage($pageposbefore + 1);
$curY = $tab_top_newpage; $curY = $tab_top_newpage;
@ -460,7 +460,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
{ {
$pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi $pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi
// $pdf->Image does not increase value return by getY, so we save it manually // $pdf->Image does not increase value return by getY, so we save it manually
$posYAfterImage=$curY+$imglinesize['height']; $posYAfterImage = $curY + $imglinesize['height'];
} }
} }
@ -499,7 +499,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
$pdf->commitTransaction(); $pdf->commitTransaction();
} }
$posYAfterDescription=$pdf->GetY(); $posYAfterDescription = $pdf->GetY();
} }
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
@ -708,20 +708,20 @@ class pdf_storm extends ModelePDFDeliveryOrder
if (empty($hidetop)) if (empty($hidetop))
{ {
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)); if (!empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
} }
$pdf->SetDrawColor(128, 128, 128); $pdf->SetDrawColor(128, 128, 128);
$pdf->SetFont('', '', $default_font_size - 1); $pdf->SetFont('', '', $default_font_size - 1);
// Output Rect // Output Rect
$this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter
$this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
if (empty($hidetop)){ if (empty($hidetop)) {
$pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line takes a position y in 2nd parameter and 4th parameter $pdf->line($this->marge_gauche, $tab_top + $this->tabTitleHeight, $this->page_largeur - $this->marge_droite, $tab_top + $this->tabTitleHeight); // line takes a position y in 2nd parameter and 4th parameter
} }
} }

View File

@ -191,12 +191,12 @@ class pdf_espadon extends ModelePdfExpedition
$objphoto = new Product($this->db); $objphoto = new Product($this->db);
$objphoto->fetch($object->lines[$i]->fk_product); $objphoto->fetch($object->lines[$i]->fk_product);
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
{ {
$pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product') . $object->lines[$i]->fk_product ."/photos/"; $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/";
$dir = $conf->product->dir_output.'/'.$pdir; $dir = $conf->product->dir_output.'/'.$pdir;
} else { } else {
$pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product') . dol_sanitizeFileName($objphoto->ref).'/'; $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
$dir = $conf->product->dir_output.'/'.$pdir; $dir = $conf->product->dir_output.'/'.$pdir;
} }

View File

@ -453,12 +453,12 @@ class ExportExcel2007new extends ModeleExports
try { try {
$this->workbook->getActiveSheet()->setCellValue($startCell, $val); $this->workbook->getActiveSheet()->setCellValue($startCell, $val);
if (! empty($endCell)) { if (!empty($endCell)) {
$cellRange = $startCell.':'.$endCell; $cellRange = $startCell.':'.$endCell;
$this->workbook->getActiveSheet()->mergeCells($startCell.':'.$endCell); $this->workbook->getActiveSheet()->mergeCells($startCell.':'.$endCell);
} }
else $cellRange = $startCell; else $cellRange = $startCell;
if (! empty($this->styleArray)) $this->workbook->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styleArray); if (!empty($this->styleArray)) $this->workbook->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styleArray);
} }
catch (Exception $e) { catch (Exception $e) {
$this->error = $e->getMessage(); $this->error = $e->getMessage();
@ -534,7 +534,7 @@ class ExportExcel2007new extends ModeleExports
public function setBlock($startCell, $TDatas = array(), $boldTitle = false) public function setBlock($startCell, $TDatas = array(), $boldTitle = false)
{ {
try { try {
if (! empty($TDatas)) { if (!empty($TDatas)) {
$startCell = $this->workbook->getActiveSheet()->getCell($startCell); $startCell = $this->workbook->getActiveSheet()->getCell($startCell);
$startColumn = Coordinate::columnIndexFromString($startCell->getColumn()); $startColumn = Coordinate::columnIndexFromString($startCell->getColumn());
$startRow = $startCell->getRow(); $startRow = $startCell->getRow();
@ -571,7 +571,7 @@ class ExportExcel2007new extends ModeleExports
public function setBlock2Columns($startCell, $TDatas = array(), $boldTitle = false) public function setBlock2Columns($startCell, $TDatas = array(), $boldTitle = false)
{ {
try { try {
if (! empty($TDatas)) { if (!empty($TDatas)) {
$startCell = $this->workbook->getActiveSheet()->getCell($startCell); $startCell = $this->workbook->getActiveSheet()->getCell($startCell);
$startColumn = Coordinate::columnIndexFromString($startCell->getColumn()); $startColumn = Coordinate::columnIndexFromString($startCell->getColumn());
$startRow = $startCell->getRow(); $startRow = $startCell->getRow();
@ -622,7 +622,7 @@ class ExportExcel2007new extends ModeleExports
try { try {
$startCell = $this->workbook->getActiveSheet()->getCell($startCell); $startCell = $this->workbook->getActiveSheet()->getCell($startCell);
$startColumn = Coordinate::columnIndexFromString($startCell->getColumn()); $startColumn = Coordinate::columnIndexFromString($startCell->getColumn());
if (! empty($offset)) $startColumn += $offset; if (!empty($offset)) $startColumn += $offset;
$startRow = $startCell->getRow(); $startRow = $startCell->getRow();
$startCell = $this->workbook->getActiveSheet()->getCellByColumnAndRow($startColumn, $startRow); $startCell = $this->workbook->getActiveSheet()->getCellByColumnAndRow($startColumn, $startRow);

View File

@ -830,11 +830,11 @@ class modFournisseur extends DolibarrModules
//Import Purchase Orders //Import Purchase Orders
$r++; $r++;
$this->import_code[$r] = 'commande_fournisseur_' . $r; $this->import_code[$r] = 'commande_fournisseur_'.$r;
$this->import_label[$r] = 'Purchase Orders'; $this->import_label[$r] = 'Purchase Orders';
$this->import_icon[$r] = $this->picto; $this->import_icon[$r] = $this->picto;
$this->import_entities_array[$r] = []; $this->import_entities_array[$r] = [];
$this->import_tables_array[$r] = ['c' => MAIN_DB_PREFIX . 'commande_fournisseur', 'extra' => MAIN_DB_PREFIX . 'commande_fournisseur_extrafields']; $this->import_tables_array[$r] = ['c' => MAIN_DB_PREFIX.'commande_fournisseur', 'extra' => MAIN_DB_PREFIX.'commande_fournisseur_extrafields'];
$this->import_tables_creator_array[$r] = ['c' => 'fk_user_author']; // Fields to store import user id $this->import_tables_creator_array[$r] = ['c' => 'fk_user_author']; // Fields to store import user id
$this->import_fields_array[$r] = [ $this->import_fields_array[$r] = [
'c.ref' => 'Document Ref*', 'c.ref' => 'Document Ref*',
@ -863,7 +863,7 @@ class modFournisseur extends DolibarrModules
'c.model_pdf' => 'Model' 'c.model_pdf' => 'Model'
]; ];
if (! empty($conf->multicurrency->enabled)) { if (!empty($conf->multicurrency->enabled)) {
$this->import_fields_array[$r]['c.multicurrency_code'] = 'Currency'; $this->import_fields_array[$r]['c.multicurrency_code'] = 'Currency';
$this->import_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate'; $this->import_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate';
$this->import_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; $this->import_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@ -873,23 +873,23 @@ class modFournisseur extends DolibarrModules
// Add extra fields // Add extra fields
$import_extrafield_sample = []; $import_extrafield_sample = [];
$sql = "SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'commande_fournisseur' AND entity IN (0, " . $conf->entity . ")"; $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseur' AND entity IN (0, ".$conf->entity.")";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
while ($obj = $this->db->fetch_object($resql)) { while ($obj = $this->db->fetch_object($resql)) {
$fieldname = 'extra.' . $obj->name; $fieldname = 'extra.'.$obj->name;
$fieldlabel = ucfirst($obj->label); $fieldlabel = ucfirst($obj->label);
$this->import_fields_array[$r][$fieldname] = $fieldlabel . ($obj->fieldrequired ? '*' : ''); $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : '');
$import_extrafield_sample[$fieldname] = $fieldlabel; $import_extrafield_sample[$fieldname] = $fieldlabel;
} }
} }
// End add extra fields // End add extra fields
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-' . MAIN_DB_PREFIX . 'commande_fournisseur']; $this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'commande_fournisseur'];
$this->import_regex_array[$r] = [ $this->import_regex_array[$r] = [
'c.ref' => '(PO\d{4}-\d{4}|PORDER.{1,32}$|PROV.{1,32}$)', 'c.ref' => '(PO\d{4}-\d{4}|PORDER.{1,32}$|PROV.{1,32}$)',
'c.multicurrency_code' => 'code@' . MAIN_DB_PREFIX . 'multicurrency' 'c.multicurrency_code' => 'code@'.MAIN_DB_PREFIX.'multicurrency'
]; ];
$this->import_updatekeys_array[$r] = ['c.ref' => 'Ref']; $this->import_updatekeys_array[$r] = ['c.ref' => 'Ref'];
@ -917,7 +917,7 @@ class modFournisseur extends DolibarrModules
$this->import_label[$r] = 'PO Lines'; $this->import_label[$r] = 'PO Lines';
$this->import_icon[$r] = $this->picto; $this->import_icon[$r] = $this->picto;
$this->import_entities_array[$r] = []; $this->import_entities_array[$r] = [];
$this->import_tables_array[$r] = ['cd' => MAIN_DB_PREFIX . 'commande_fournisseurdet', 'extra' => MAIN_DB_PREFIX . 'commande_fournisseurdet_extrafields']; $this->import_tables_array[$r] = ['cd' => MAIN_DB_PREFIX.'commande_fournisseurdet', 'extra' => MAIN_DB_PREFIX.'commande_fournisseurdet_extrafields'];
$this->import_fields_array[$r] = [ $this->import_fields_array[$r] = [
'cd.fk_commande' => 'Document Ref*', 'cd.fk_commande' => 'Document Ref*',
'cd.fk_parent_line' => 'PrParentLine', 'cd.fk_parent_line' => 'PrParentLine',
@ -941,7 +941,7 @@ class modFournisseur extends DolibarrModules
'cd.fk_unit' => 'Unit' 'cd.fk_unit' => 'Unit'
]; ];
if (! empty($conf->multicurrency->enabled)) { if (!empty($conf->multicurrency->enabled)) {
$this->import_fields_array[$r]['cd.multicurrency_code'] = 'Currency'; $this->import_fields_array[$r]['cd.multicurrency_code'] = 'Currency';
$this->import_fields_array[$r]['cd.multicurrency_subprice'] = 'CurrencyRate'; $this->import_fields_array[$r]['cd.multicurrency_subprice'] = 'CurrencyRate';
$this->import_fields_array[$r]['cd.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; $this->import_fields_array[$r]['cd.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@ -950,22 +950,22 @@ class modFournisseur extends DolibarrModules
} }
// Add extra fields // Add extra fields
$sql="SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'commande_fournisseurdet' AND entity IN (0, " . $conf->entity . ")"; $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseurdet' AND entity IN (0, ".$conf->entity.")";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
while ($obj = $this->db->fetch_object($resql)) { while ($obj = $this->db->fetch_object($resql)) {
$fieldname = 'extra.' . $obj->name; $fieldname = 'extra.'.$obj->name;
$fieldlabel = ucfirst($obj->label); $fieldlabel = ucfirst($obj->label);
$this->import_fields_array[$r][$fieldname] = $fieldlabel . ($obj->fieldrequired ? '*' : ''); $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : '');
} }
} }
// End add extra fields // End add extra fields
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-' . MAIN_DB_PREFIX . 'commande_fournisseurdet']; $this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'commande_fournisseurdet'];
$this->import_regex_array[$r] = [ $this->import_regex_array[$r] = [
'cd.product_type' => '[0|1]$', 'cd.product_type' => '[0|1]$',
'cd.fk_product' => 'rowid@' . MAIN_DB_PREFIX . 'product', 'cd.fk_product' => 'rowid@'.MAIN_DB_PREFIX.'product',
'cd.multicurrency_code' => 'code@' . MAIN_DB_PREFIX . 'multicurrency' 'cd.multicurrency_code' => 'code@'.MAIN_DB_PREFIX.'multicurrency'
]; ];
$this->import_updatekeys_array[$r] = ['cd.fk_commande' => 'Purchase Order Id']; $this->import_updatekeys_array[$r] = ['cd.fk_commande' => 'Purchase Order Id'];
$this->import_convertvalue_array[$r] = [ $this->import_convertvalue_array[$r] = [

View File

@ -23,7 +23,7 @@
* \ingroup Intracomm report * \ingroup Intracomm report
* \brief Module to activate intracomm report module * \brief Module to activate intracomm report module
*/ */
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
/** /**
@ -62,10 +62,10 @@ class modIntracommreport extends DolibarrModules
$this->config_page_url = array("intracommreport.php@intracommreport"); $this->config_page_url = array("intracommreport.php@intracommreport");
// Dependencies // Dependencies
$this->depends = array("modFacture","modTax"); // List of modules id that must be enabled if this module is enabled $this->depends = array("modFacture", "modTax"); // List of modules id that must be enabled if this module is enabled
$this->requiredby = array(); // List of modules id to disable if this one is disabled $this->requiredby = array(); // List of modules id to disable if this one is disabled
$this->conflictwith = array(); // List of modules id this module is in conflict with $this->conflictwith = array(); // List of modules id this module is in conflict with
$this->phpmin = array(5,5); // Minimum version of PHP required by module $this->phpmin = array(5, 5); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(13, 0, -5); // Minimum version of Dolibarr required by module $this->need_dolibarr_version = array(13, 0, -5); // Minimum version of Dolibarr required by module
$this->langfiles = array("intracommreport"); $this->langfiles = array("intracommreport");
@ -121,9 +121,9 @@ class modIntracommreport extends DolibarrModules
// Main menu entries // Main menu entries
$this->menu = array(); // List of menus to add $this->menu = array(); // List of menus to add
$r=0; $r = 0;
// Exports // Exports
$r=1; $r = 1;
} }
} }

View File

@ -661,7 +661,7 @@ class modProduct extends DolibarrModules
} }
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) { if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
$this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array('sp.packaging' => 'PackagingForThisProduct')); $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('sp.packaging' => 'PackagingForThisProduct'));
} }
$this->import_convertvalue_array[$r] = array( $this->import_convertvalue_array[$r] = array(

View File

@ -295,7 +295,7 @@ class modSociete extends DolibarrModules
's.rowid'=>"Numeric", 's.nom'=>"Text", 's.name_alias'=>"Text", 'ps.nom'=>"Text", 's.rowid'=>"Numeric", 's.nom'=>"Text", 's.name_alias'=>"Text", 'ps.nom'=>"Text",
's.status'=>"Numeric", 's.client'=>"Numeric", 's.fournisseur'=>"Boolean", 's.datec'=>"Date", 's.tms'=>"Date", 's.status'=>"Numeric", 's.client'=>"Numeric", 's.fournisseur'=>"Boolean", 's.datec'=>"Date", 's.tms'=>"Date",
's.code_client'=>"Text", 's.code_fournisseur'=>"Text", 's.code_compta'=>"Text", 's.code_compta_fournisseur'=>"Text", 's.code_client'=>"Text", 's.code_fournisseur'=>"Text", 's.code_compta'=>"Text", 's.code_compta_fournisseur'=>"Text",
's.address'=>"Text", 's.zip'=>"Text",'s.town'=>"Text", 's.address'=>"Text", 's.zip'=>"Text", 's.town'=>"Text",
'd.nom'=>'Text', 'r.nom'=>'Text', 'c.label'=>"List:c_country:label:label", 'c.code'=>"Text", 'd.nom'=>'Text', 'r.nom'=>'Text', 'c.label'=>"List:c_country:label:label", 'c.code'=>"Text",
's.phone'=>"Text", 's.fax'=>"Text", 's.phone'=>"Text", 's.fax'=>"Text",
's.url'=>"Text", 's.email'=>"Text", 's.default_lang'=>"Text", 's.canvas' => "Canvas", 's.url'=>"Text", 's.email'=>"Text", 's.default_lang'=>"Text", 's.canvas' => "Canvas",

View File

@ -479,54 +479,54 @@ if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
} }
if (!empty($extrafields->attributes[$elementtype]['label'])) { if (!empty($extrafields->attributes[$elementtype]['label'])) {
foreach ($extrafields->attributes[$elementtype]['label'] as $key => $val) { foreach ($extrafields->attributes[$elementtype]['label'] as $key => $val) {
print '<tr><td>' . $extrafields->attributes[$elementtype]['label'][$key]; print '<tr><td>'.$extrafields->attributes[$elementtype]['label'][$key];
if ($array_query['options_' . $key . '_cnct'] != '' || (is_array($array_query['options_' . $key . '_cnct']) && count($array_query['options_' . $key . '_cnct']) > 0)) { if ($array_query['options_'.$key.'_cnct'] != '' || (is_array($array_query['options_'.$key.'_cnct']) && count($array_query['options_'.$key.'_cnct']) > 0)) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>'; print '</td><td>';
if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') || ($extrafields->attributes[$elementtype]['type'][$key] == 'text')) { if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') || ($extrafields->attributes[$elementtype]['type'][$key] == 'text')) {
print '<input type="text" name="options_' . $key . '_cnct"/></td><td>' . "\n"; print '<input type="text" name="options_'.$key.'_cnct"/></td><td>'."\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') || ($extrafields->attributes[$elementtype]['type'][$key] == 'double')) { } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') || ($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options_' . $key . '_min_cnct"/>'; print $langs->trans("AdvTgtMinVal").'<input type="text" name="options_'.$key.'_min_cnct"/>';
print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options_' . $key . '_max_cnct"/>'; print $langs->trans("AdvTgtMaxVal").'<input type="text" name="options_'.$key.'_max_cnct"/>';
print '</td><td>' . "\n"; print '</td><td>'."\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help');
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') || ($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) { } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') || ($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
print '<table class="nobordernopadding"><tr>'; print '<table class="nobordernopadding"><tr>';
print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; print '<td>'.$langs->trans("AdvTgtStartDt").'</td><td>';
print $form->selectDate('', 'options_' . $key . '_st_dt_cnct'); print $form->selectDate('', 'options_'.$key.'_st_dt_cnct');
print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; print '</td><td>'.$langs->trans("AdvTgtEndDt").'</td><td>';
print $form->selectDate('', 'options_' . $key . '_end_dt_cnct'); print $form->selectDate('', 'options_'.$key.'_end_dt_cnct');
print '</td></tr></table>'; print '</td></tr></table>';
print '</td><td>' . "\n"; print '</td><td>'."\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help');
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'boolean')) { } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'boolean')) {
print $form->selectarray( print $form->selectarray(
'options_' . $key . '_cnct', 'options_'.$key.'_cnct',
array( array(
'' => '', '' => '',
'1' => $langs->trans('Yes'), '1' => $langs->trans('Yes'),
'0' => $langs->trans('No') '0' => $langs->trans('No')
), ),
$array_query['options_' . $key . '_cnct'] $array_query['options_'.$key.'_cnct']
); );
print '</td><td>' . "\n"; print '</td><td>'."\n";
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'select')) { } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'select')) {
print $formadvtargetemaling->advMultiselectarray('options_' . $key . '_cnct', $extrafields->attributes[$key]['param']['options'], $array_query['options_' . $key . '_cnct']); print $formadvtargetemaling->advMultiselectarray('options_'.$key.'_cnct', $extrafields->attributes[$key]['param']['options'], $array_query['options_'.$key.'_cnct']);
print '</td><td>' . "\n"; print '</td><td>'."\n";
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'sellist')) { } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'sellist')) {
print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key . '_cnct', $extrafields->attributes[$key]['param']['options'], $array_query['options_' . $key . '_cnct']); print $formadvtargetemaling->advMultiselectarraySelllist('options_'.$key.'_cnct', $extrafields->attributes[$key]['param']['options'], $array_query['options_'.$key.'_cnct']);
print '</td><td>' . "\n"; print '</td><td>'."\n";
} else { } else {
if (is_array($array_query['options_' . $key . '_cnct'])) { if (is_array($array_query['options_'.$key.'_cnct'])) {
print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key . '_cnct']), '', '_cnct'); print $extrafields->showInputField($key, implode(',', $array_query['options_'.$key.'_cnct']), '', '_cnct');
} else { } else {
print $extrafields->showInputField($key, $array_query['options_' . $key . '_cnct'], '', '_cnct'); print $extrafields->showInputField($key, $array_query['options_'.$key.'_cnct'], '', '_cnct');
} }
print '</td><td>' . "\n"; print '</td><td>'."\n";
} }
print '</td></tr>' . "\n"; print '</td></tr>'."\n";
} }
} }
} }

View File

@ -144,7 +144,7 @@ if ($action == 'presend')
$formmail->fromtype = 'special'; $formmail->fromtype = 'special';
} }
$formmail->trackid=$trackid; $formmail->trackid = $trackid;
if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{ {
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';

View File

@ -59,7 +59,7 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
} else { } else {
$titleofloginpage = $langs->trans('Login'); $titleofloginpage = $langs->trans('Login');
} }
$titleofloginpage.= ' @ '.$titletruedolibarrversion; // $titletruedolibarrversion is defined by dol_loginfunction in security2.lib.php. We must keep the @, some tools use it to know it is login page and find true dolibarr version. $titleofloginpage .= ' @ '.$titletruedolibarrversion; // $titletruedolibarrversion is defined by dol_loginfunction in security2.lib.php. We must keep the @, some tools use it to know it is login page and find true dolibarr version.
$disablenofollow = 1; $disablenofollow = 1;
if (!preg_match('/'.constant('DOL_APPLICATION_TITLE').'/', $title)) $disablenofollow = 0; if (!preg_match('/'.constant('DOL_APPLICATION_TITLE').'/', $title)) $disablenofollow = 0;

View File

@ -307,20 +307,20 @@ if (!empty($extrafields))
<script> <script>
<?php <?php
if (! empty($usemargins) && $user->rights->margins->creer) if (!empty($usemargins) && $user->rights->margins->creer)
{ {
?> ?>
/* Some js test when we click on button "Add" */ /* Some js test when we click on button "Add" */
jQuery(document).ready(function() { jQuery(document).ready(function() {
<?php <?php
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
?> ?>
$("input[name='np_marginRate']:first").blur(function(e) { $("input[name='np_marginRate']:first").blur(function(e) {
return checkFreeLine(e, "np_marginRate"); return checkFreeLine(e, "np_marginRate");
}); });
<?php <?php
} }
if (! empty($conf->global->DISPLAY_MARK_RATES)) { if (!empty($conf->global->DISPLAY_MARK_RATES)) {
?> ?>
$("input[name='np_markRate']:first").blur(function(e) { $("input[name='np_markRate']:first").blur(function(e) {
return checkFreeLine(e, "np_markRate"); return checkFreeLine(e, "np_markRate");

View File

@ -168,7 +168,7 @@ class InterfaceStripe extends DolibarrTriggers
if ($action == 'COMPANY_DELETE') { if ($action == 'COMPANY_DELETE') {
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->global->STRIPE_DELETE_STRIPE_ACCOUNT_WHEN_DELETING_THIRPARTY)) { if (!empty($conf->global->STRIPE_DELETE_STRIPE_ACCOUNT_WHEN_DELETING_THIRPARTY)) {
// By default, we do not delete the stripe account. We may need to reuse it with its payment_intent, for example if delete is for a merge of thirdparties. // By default, we do not delete the stripe account. We may need to reuse it with its payment_intent, for example if delete is for a merge of thirdparties.
$stripeacc = $stripe->getStripeAccount($service); // No need of network access for this. May return '' if no Oauth defined. $stripeacc = $stripe->getStripeAccount($service); // No need of network access for this. May return '' if no Oauth defined.

View File

@ -80,6 +80,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers
$actions = explode('_', $action); $actions = explode('_', $action);
$sql = 'SELECT rowid, url FROM '.MAIN_DB_PREFIX.'zapier_hook'; $sql = 'SELECT rowid, url FROM '.MAIN_DB_PREFIX.'zapier_hook';
$sql .= ' WHERE module="'.$this->db->escape(strtolower($actions[0])).'" AND action="'.$this->db->escape(strtolower($actions[1])).'"'; $sql .= ' WHERE module="'.$this->db->escape(strtolower($actions[0])).'" AND action="'.$this->db->escape(strtolower($actions[1])).'"';
//setEventMessages($sql, null);
} }
switch ($action) { switch ($action) {
@ -130,6 +131,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers
$json = json_encode($cleaned); $json = json_encode($cleaned);
// call the zapierPostWebhook() function // call the zapierPostWebhook() function
zapierPostWebhook($obj['url'], $json); zapierPostWebhook($obj['url'], $json);
//setEventMessages($obj['url'], null);
} }
$logtriggeraction = true; $logtriggeraction = true;
break; break;

View File

@ -146,7 +146,7 @@ if ($action == 'update')
$newfile = $newdir.$newlabel; $newfile = $newdir.$newlabel;
$newfileformove = $newfile; $newfileformove = $newfile;
// If old file end with .noexe, new file must also end with .noexe // If old file end with .noexe, new file must also end with .noexe
if (preg_match('/\.noexe$/', $oldfile) && ! preg_match('/\.noexe$/', $newfileformove)) { if (preg_match('/\.noexe$/', $oldfile) && !preg_match('/\.noexe$/', $newfileformove)) {
$newfileformove .= '.noexe'; $newfileformove .= '.noexe';
} }
//var_dump($oldfile);var_dump($newfile);exit; //var_dump($oldfile);var_dump($newfile);exit;

View File

@ -338,10 +338,10 @@ class Expedition extends CommonObject
$sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : "null"); $sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : "null");
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : "null"); $sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : "null");
$sql .= ", '".$this->db->escape($this->tracking_number)."'"; $sql .= ", '".$this->db->escape($this->tracking_number)."'";
$sql.= ", ".(is_numeric($this->weight)?$this->weight:'NULL'); $sql .= ", ".(is_numeric($this->weight) ? $this->weight : 'NULL');
$sql.= ", ".(is_numeric($this->sizeS)?$this->sizeS:'NULL'); // TODO Should use this->trueDepth $sql .= ", ".(is_numeric($this->sizeS) ? $this->sizeS : 'NULL'); // TODO Should use this->trueDepth
$sql.= ", ".(is_numeric($this->sizeW)?$this->sizeW:'NULL'); // TODO Should use this->trueWidth $sql .= ", ".(is_numeric($this->sizeW) ? $this->sizeW : 'NULL'); // TODO Should use this->trueWidth
$sql.= ", ".(is_numeric($this->sizeH)?$this->sizeH:'NULL'); // TODO Should use this->trueHeight $sql .= ", ".(is_numeric($this->sizeH) ? $this->sizeH : 'NULL'); // TODO Should use this->trueHeight
$sql .= ", ".($this->weight_units != '' ? (int) $this->weight_units : 'NULL'); $sql .= ", ".($this->weight_units != '' ? (int) $this->weight_units : 'NULL');
$sql .= ", ".($this->size_units != '' ? (int) $this->size_units : 'NULL'); $sql .= ", ".($this->size_units != '' ? (int) $this->size_units : 'NULL');
$sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null"); $sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null");
@ -1164,8 +1164,8 @@ class Expedition extends CommonObject
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionbatch.class.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionbatch.class.php';
$error=0; $error = 0;
$this->error=''; $this->error = '';
$this->db->begin(); $this->db->begin();
@ -1173,23 +1173,23 @@ class Expedition extends CommonObject
$this->fetchObjectLinked($this->id, 'shipping', 0, 'delivery'); // Get deliveries linked to this shipment $this->fetchObjectLinked($this->id, 'shipping', 0, 'delivery'); // Get deliveries linked to this shipment
if (count($this->linkedObjectsIds) > 0) if (count($this->linkedObjectsIds) > 0)
{ {
$this->error='ErrorThereIsSomeDeliveries'; $this->error = 'ErrorThereIsSomeDeliveries';
$error++; $error++;
} }
if (! $error) if (!$error)
{ {
if (! $notrigger) if (!$notrigger)
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('SHIPPING_CANCEL', $user); $result = $this->call_trigger('SHIPPING_CANCEL', $user);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
// End call triggers // End call triggers
} }
} }
// Stock control // Stock control
if (! $error && $conf->stock->enabled && if (!$error && $conf->stock->enabled &&
(($conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT) || (($conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT) ||
($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE && $this->statut == self::STATUS_CLOSED && $also_update_stock))) ($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE && $this->statut == self::STATUS_CLOSED && $also_update_stock)))
{ {

View File

@ -175,7 +175,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_state = ""; $search_state = "";
$search_type = ''; $search_type = '';
$search_country = ''; $search_country = '';
$search_tracking=''; $search_tracking = '';
$search_type_thirdparty = ''; $search_type_thirdparty = '';
$search_billed = ''; $search_billed = '';
$search_datedelivery_start = ''; $search_datedelivery_start = '';
@ -277,7 +277,7 @@ if ($search_town) $sql .= natural_search('s.town', $search_town);
if ($search_zip) $sql .= natural_search("s.zip", $search_zip); if ($search_zip) $sql .= natural_search("s.zip", $search_zip);
if ($search_state) $sql .= natural_search("state.nom", $search_state); if ($search_state) $sql .= natural_search("state.nom", $search_state);
if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
if ($search_tracking) $sql.= natural_search("e.tracking_number", $search_tracking); if ($search_tracking) $sql .= natural_search("e.tracking_number", $search_tracking);
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale; if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale;
if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp); if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp);
@ -335,7 +335,7 @@ if ($resql)
if ($search_user > 0) $param .= '&search_user='.urlencode($search_user); if ($search_user > 0) $param .= '&search_user='.urlencode($search_user);
if ($search_sale > 0) $param .= '&search_sale='.urlencode($search_sale); if ($search_sale > 0) $param .= '&search_sale='.urlencode($search_sale);
if ($search_company) $param .= "&amp;search_company=".urlencode($search_company); if ($search_company) $param .= "&amp;search_company=".urlencode($search_company);
if ($search_tracking) $param.= "&amp;search_tracking=".urlencode($search_tracking); if ($search_tracking) $param .= "&amp;search_tracking=".urlencode($search_tracking);
if ($search_town) $param .= '&search_town='.urlencode($search_town); if ($search_town) $param .= '&search_town='.urlencode($search_town);
if ($search_zip) $param .= '&search_zip='.urlencode($search_zip); if ($search_zip) $param .= '&search_zip='.urlencode($search_zip);
@ -514,7 +514,7 @@ if ($resql)
print '</td>'; print '</td>';
} }
// Tracking number // Tracking number
if (! empty($arrayfields['e.tracking_number']['checked'])) if (!empty($arrayfields['e.tracking_number']['checked']))
{ {
print '<td class="liste_titre center">'; print '<td class="liste_titre center">';
print '<input class="flat" size="6" type="text" name="search_tracking" value="'.dol_escape_htmltag($search_tracking).'">'; print '<input class="flat" size="6" type="text" name="search_tracking" value="'.dol_escape_htmltag($search_tracking).'">';
@ -592,7 +592,7 @@ if ($resql)
if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['e.weight']['checked'])) print_liste_field_titre($arrayfields['e.weight']['label'], $_SERVER["PHP_SELF"], "e.weight", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['e.weight']['checked'])) print_liste_field_titre($arrayfields['e.weight']['label'], $_SERVER["PHP_SELF"], "e.weight", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['e.date_delivery']['checked'])) print_liste_field_titre($arrayfields['e.date_delivery']['label'], $_SERVER["PHP_SELF"], "e.date_delivery", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['e.date_delivery']['checked'])) print_liste_field_titre($arrayfields['e.date_delivery']['label'], $_SERVER["PHP_SELF"], "e.date_delivery", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['e.tracking_number']['checked'])) print_liste_field_titre($arrayfields['e.tracking_number']['label'], $_SERVER["PHP_SELF"], "e.tracking_number", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['e.tracking_number']['checked'])) print_liste_field_titre($arrayfields['e.tracking_number']['label'], $_SERVER["PHP_SELF"], "e.tracking_number", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['l.ref']['checked'])) print_liste_field_titre($arrayfields['l.ref']['label'], $_SERVER["PHP_SELF"], "l.ref", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['l.ref']['checked'])) print_liste_field_titre($arrayfields['l.ref']['label'], $_SERVER["PHP_SELF"], "l.ref", "", $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['l.date_delivery']['checked'])) print_liste_field_titre($arrayfields['l.date_delivery']['label'], $_SERVER["PHP_SELF"], "l.date_delivery", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['l.date_delivery']['checked'])) print_liste_field_titre($arrayfields['l.date_delivery']['label'], $_SERVER["PHP_SELF"], "l.date_delivery", "", $param, '', $sortfield, $sortorder, 'center ');
// Extra fields // Extra fields
@ -719,10 +719,10 @@ if ($resql)
print "</td>\n"; print "</td>\n";
} }
// Tracking number // Tracking number
if (! empty($arrayfields['e.tracking_number']['checked'])) if (!empty($arrayfields['e.tracking_number']['checked']))
{ {
print '<td class="center">'.$obj->tracking_number."</td>\n"; print '<td class="center">'.$obj->tracking_number."</td>\n";
if (! $i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
} }
if (!empty($arrayfields['l.ref']['checked']) || !empty($arrayfields['l.date_delivery']['checked'])) if (!empty($arrayfields['l.ref']['checked']) || !empty($arrayfields['l.date_delivery']['checked']))

View File

@ -230,7 +230,7 @@ if (empty($reshook))
setEventMessages($langs->trans("NotEnoughPermission"), null, 'errors'); setEventMessages($langs->trans("NotEnoughPermission"), null, 'errors');
} else { } else {
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)) { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)) {
if (! in_array($object->fk_user_author, $childids)) { if (!in_array($object->fk_user_author, $childids)) {
$error++; $error++;
setEventMessages($langs->trans("UserNotInHierachy"), null, 'errors'); setEventMessages($langs->trans("UserNotInHierachy"), null, 'errors');
} }

View File

@ -425,9 +425,9 @@ if ($object->id > 0)
$link = DOL_URL_ROOT.'/fourn/recap-fourn.php?socid='.$object->id; $link = DOL_URL_ROOT.'/fourn/recap-fourn.php?socid='.$object->id;
$icon = 'bill'; $icon = 'bill';
if ($link) $boxstat .= '<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">'; if ($link) $boxstat .= '<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
$boxstat .= '<div class="boxstats" title="' . dol_escape_htmltag($text) . '">'; $boxstat .= '<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
$boxstat .= '<span class="boxstatstext">' . img_object("", $icon) . ' <span>' . $text . '</span></span><br>'; $boxstat .= '<span class="boxstatstext">'.img_object("", $icon).' <span>'.$text.'</span></span><br>';
$boxstat .= '<span class="boxstatsindicator' . ($outstandingOpenedLate > 0 ? ' amountremaintopay' : '') . '">'.price($outstandingOpenedLate, 1, $langs, 1, -1, -1, $conf->currency) . $warn . '</span>'; $boxstat .= '<span class="boxstatsindicator'.($outstandingOpenedLate > 0 ? ' amountremaintopay' : '').'">'.price($outstandingOpenedLate, 1, $langs, 1, -1, -1, $conf->currency).$warn.'</span>';
$boxstat .= '</div>'; $boxstat .= '</div>';
if ($link) $boxstat .= '</a>'; if ($link) $boxstat .= '</a>';
} }

View File

@ -176,7 +176,7 @@ class PaiementFourn extends Paiement
foreach ($amounts as $key => $value) foreach ($amounts as $key => $value)
{ {
$value_converted = Multicurrency::getAmountConversionFromInvoiceRate($key, $value? $value : 0, $way, 'facture_fourn'); $value_converted = Multicurrency::getAmountConversionFromInvoiceRate($key, $value ? $value : 0, $way, 'facture_fourn');
$totalamount_converted += $value_converted; $totalamount_converted += $value_converted;
$amounts_to_update[$key] = price2num($value_converted, 'MT'); $amounts_to_update[$key] = price2num($value_converted, 'MT');

View File

@ -872,7 +872,7 @@ if (empty($reshook))
$action = 'confirm_approve'; // can make standard or first level approval also if permission is set $action = 'confirm_approve'; // can make standard or first level approval also if permission is set
} }
if (! $error) { if (!$error) {
$db->commit(); $db->commit();
} else { } else {
$db->rollback(); $db->rollback();
@ -1059,7 +1059,7 @@ if (empty($reshook))
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Delivery")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Delivery")), null, 'errors');
} }
if (! $error) { if (!$error) {
$db->commit(); $db->commit();
} else { } else {
$db->rollback(); $db->rollback();

View File

@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
require_once DOL_DOCUMENT_ROOT . '/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
if (!empty($conf->projet->enabled)) if (!empty($conf->projet->enabled))
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@ -276,7 +276,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
$sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price";
$sql .= " SET unitprice='".GETPOST($pu)."'"; $sql .= " SET unitprice='".GETPOST($pu)."'";
$sql .= ", price=".GETPOST($pu)."*quantity"; $sql .= ", price=".GETPOST($pu)."*quantity";
$sql .= ", remise_percent='".(!empty($dto)?$dto:0)."'"; $sql .= ", remise_percent='".(!empty($dto) ? $dto : 0)."'";
$sql .= " WHERE fk_soc=".$object->socid; $sql .= " WHERE fk_soc=".$object->socid;
$sql .= " AND fk_product=".GETPOST($prod, 'int'); $sql .= " AND fk_product=".GETPOST($prod, 'int');
@ -348,7 +348,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
$sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price";
$sql .= " SET unitprice='".GETPOST($pu)."'"; $sql .= " SET unitprice='".GETPOST($pu)."'";
$sql .= ", price=".GETPOST($pu)."*quantity"; $sql .= ", price=".GETPOST($pu)."*quantity";
$sql .= ", remise_percent='".(!empty($dto)?$dto:0)."'"; $sql .= ", remise_percent='".(!empty($dto) ? $dto : 0)."'";
$sql .= " WHERE fk_soc=".$object->socid; $sql .= " WHERE fk_soc=".$object->socid;
$sql .= " AND fk_product=".GETPOST($prod, 'int'); $sql .= " AND fk_product=".GETPOST($prod, 'int');
@ -419,16 +419,16 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fourn
} }
else { else {
// If module stock is enabled and the stock increase is done on purchase order dispatching // If module stock is enabled and the stock increase is done on purchase order dispatching
if ($entrepot > 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) if ($entrepot > 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER))
{ {
$mouv = new MouvementStock($db); $mouv = new MouvementStock($db);
if ($product > 0) if ($product > 0)
{ {
$mouv->origin = &$object; $mouv->origin = &$object;
$result=$mouv->livraison($user, $product, $entrepot, $qty, $price, $comment, '', $eatby, $sellby, $batch); $result = $mouv->livraison($user, $product, $entrepot, $qty, $price, $comment, '', $eatby, $sellby, $batch);
if ($result < 0) if ($result < 0)
{ {
$errors=$mouv->errors; $errors = $mouv->errors;
$error++; $error++;
} }
} }
@ -470,28 +470,28 @@ if ($action == 'updateline' && $user->rights->fournisseur->commande->receptionne
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;
$errors=$supplierorderdispatch->errors; $errors = $supplierorderdispatch->errors;
} }
else { else {
// If module stock is enabled and the stock increase is done on purchase order dispatching // If module stock is enabled and the stock increase is done on purchase order dispatching
if ($entrepot > 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) if ($entrepot > 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER))
{ {
$mouv = new MouvementStock($db); $mouv = new MouvementStock($db);
if ($product > 0) if ($product > 0)
{ {
$mouv->origin = &$object; $mouv->origin = &$object;
$result=$mouv->livraison($user, $product, $entrepot, $qty, $price, $comment, '', $eatby, $sellby, $batch); $result = $mouv->livraison($user, $product, $entrepot, $qty, $price, $comment, '', $eatby, $sellby, $batch);
if ($result < 0) if ($result < 0)
{ {
$errors=$mouv->errors; $errors = $mouv->errors;
$error++; $error++;
} }
else { else {
$mouv->origin = &$object; $mouv->origin = &$object;
$result=$mouv->reception($user, $product, $supplierorderdispatch->fk_entrepot, $supplierorderdispatch->qty, $price, $comment, $eatby, $sellby, $batch); $result = $mouv->reception($user, $product, $supplierorderdispatch->fk_entrepot, $supplierorderdispatch->qty, $price, $comment, $eatby, $sellby, $batch);
if ($result < 0) if ($result < 0)
{ {
$errors=$mouv->errors; $errors = $mouv->errors;
$error++; $error++;
} }
} }
@ -534,20 +534,20 @@ if ($id > 0 || !empty($ref)) {
$title = $langs->trans("SupplierOrder"); $title = $langs->trans("SupplierOrder");
print dol_get_fiche_head($head, 'dispatch', $title, -1, 'order'); print dol_get_fiche_head($head, 'dispatch', $title, -1, 'order');
$formconfirm=''; $formconfirm = '';
// Confirmation to delete line // Confirmation to delete line
if ($action == 'ask_deleteline') if ($action == 'ask_deleteline')
{ {
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
} }
// Call Hook formConfirm // Call Hook formConfirm
$parameters = array('lineid' => $lineid); $parameters = array('lineid' => $lineid);
// Note that $action and $object may be modified by hook // Note that $action and $object may be modified by hook
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action);
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint; if (empty($reshook)) $formconfirm .= $hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint; elseif ($reshook > 0) $formconfirm = $hookmanager->resPrint;
// Print form confirm // Print form confirm
print $formconfirm; print $formconfirm;
@ -652,7 +652,7 @@ if ($id > 0 || !empty($ref)) {
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
$formproduct->loadWarehouses(); $formproduct->loadWarehouses();
$entrepot = new Entrepot($db); $entrepot = new Entrepot($db);
$listwarehouses=$entrepot->list_array(1); $listwarehouses = $entrepot->list_array(1);
if (empty($conf->reception->enabled))print '<form method="POST" action="dispatch.php?id='.$object->id.'">'; if (empty($conf->reception->enabled))print '<form method="POST" action="dispatch.php?id='.$object->id.'">';
@ -910,8 +910,8 @@ if ($id > 0 || !empty($ref)) {
print '</td>'; print '</td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="nowraponall">'; print '<td class="nowraponall">';
$dlcdatesuffix = dol_mktime(0, 0, 0, GETPOST('dlc' . $suffix . 'month'), GETPOST('dlc' . $suffix . 'day'), GETPOST('dlc' . $suffix . 'year')); $dlcdatesuffix = dol_mktime(0, 0, 0, GETPOST('dlc'.$suffix.'month'), GETPOST('dlc'.$suffix.'day'), GETPOST('dlc'.$suffix.'year'));
print $form->selectDate($dlcdatesuffix, 'dlc' . $suffix, '', '', 1, ''); print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, '', '', 1, '');
print '</td>'; print '</td>';
} }
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
@ -991,7 +991,7 @@ if ($id > 0 || !empty($ref)) {
// Discount // Discount
print '<td class="right">'; print '<td class="right">';
print '<input id="dto' . $suffix . '" name="dto' . $suffix . '" type="text" size="8" value="' . (GETPOST('dto' . $suffix) != '' ? GETPOST('dto' . $suffix) : '') . '">'; print '<input id="dto'.$suffix.'" name="dto'.$suffix.'" type="text" size="8" value="'.(GETPOST('dto'.$suffix) != '' ? GETPOST('dto'.$suffix) : '').'">';
print '</td>'; print '</td>';
// Save price // Save price
@ -1105,11 +1105,11 @@ if ($id > 0 || !empty($ref)) {
$sql = "SELECT p.rowid as pid, p.ref, p.label,"; $sql = "SELECT p.rowid as pid, p.ref, p.label,";
$sql .= " e.rowid as warehouse_id, e.ref as entrepot,"; $sql .= " e.rowid as warehouse_id, e.ref as entrepot,";
$sql .= " cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.datec"; $sql .= " cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.datec";
$sql.=" ,cd.rowid, cd.subprice"; $sql .= " ,cd.rowid, cd.subprice";
if ($conf->reception->enabled)$sql .= " ,cfd.fk_reception, r.date_delivery"; if ($conf->reception->enabled)$sql .= " ,cfd.fk_reception, r.date_delivery";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p,"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p,";
$sql .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd"; $sql .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "commande_fournisseurdet as cd ON cd.rowid = cfd.fk_commandefourndet"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_fournisseurdet as cd ON cd.rowid = cfd.fk_commandefourndet";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e ON cfd.fk_entrepot = e.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e ON cfd.fk_entrepot = e.rowid";
if ($conf->reception->enabled)$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."reception as r ON cfd.fk_reception = r.rowid"; if ($conf->reception->enabled)$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."reception as r ON cfd.fk_reception = r.rowid";
$sql .= " WHERE cfd.fk_commande = ".$object->id; $sql .= " WHERE cfd.fk_commande = ".$object->id;
@ -1138,10 +1138,10 @@ if ($id > 0 || !empty($ref)) {
if (!empty($conf->productbatch->enabled)) { if (!empty($conf->productbatch->enabled)) {
print '<td class="dispatch_batch_number_title">'.$langs->trans("batch_number").'</td>'; print '<td class="dispatch_batch_number_title">'.$langs->trans("batch_number").'</td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="dispatch_dluo_title">' . $langs->trans("EatByDate") . '</td>'; print '<td class="dispatch_dluo_title">'.$langs->trans("EatByDate").'</td>';
} }
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="dispatch_dlc_title">' . $langs->trans("SellByDate") . '</td>'; print '<td class="dispatch_dlc_title">'.$langs->trans("SellByDate").'</td>';
} }
} }
print '<td class="right">'.$langs->trans("QtyDispatched").'</td>'; print '<td class="right">'.$langs->trans("QtyDispatched").'</td>';
@ -1164,7 +1164,7 @@ if ($id > 0 || !empty($ref)) {
if ($action == 'editline' && $lineid == $objp->dispatchlineid) if ($action == 'editline' && $lineid == $objp->dispatchlineid)
{ {
print '<form name="editdispatchedlines" id="editdispatchedlines" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '#line_' . GETPOST('lineid') . '" method="POST"> print '<form name="editdispatchedlines" id="editdispatchedlines" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'#line_'.GETPOST('lineid').'" method="POST">
<input type="hidden" name="token" value="'.newToken().'"> <input type="hidden" name="token" value="'.newToken().'">
<input type="hidden" name="action" value="updateline"> <input type="hidden" name="action" value="updateline">
<input type="hidden" name="mode" value=""> <input type="hidden" name="mode" value="">
@ -1194,14 +1194,14 @@ if ($id > 0 || !empty($ref)) {
if (!empty($conf->productbatch->enabled)) { if (!empty($conf->productbatch->enabled)) {
if ($objp->batch) { if ($objp->batch) {
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
$lot=new Productlot($db); $lot = new Productlot($db);
$lot->fetch(0, $objp->pid, $objp->batch); $lot->fetch(0, $objp->pid, $objp->batch);
print '<td class="dispatch_batch_number">'.$lot->getNomUrl(1).'</td>'; print '<td class="dispatch_batch_number">'.$lot->getNomUrl(1).'</td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="dispatch_dluo">' . dol_print_date($lot->eatby, 'day') . '</td>'; print '<td class="dispatch_dluo">'.dol_print_date($lot->eatby, 'day').'</td>';
} }
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="dispatch_dlc">' . dol_print_date($lot->sellby, 'day') . '</td>'; print '<td class="dispatch_dlc">'.dol_print_date($lot->sellby, 'day').'</td>';
} }
} else { } else {
print '<td class="dispatch_batch_number"></td>'; print '<td class="dispatch_batch_number"></td>';
@ -1214,7 +1214,7 @@ if ($id > 0 || !empty($ref)) {
print '<td class="right">'; print '<td class="right">';
if ($action == 'editline' && $lineid == $objp->dispatchlineid) if ($action == 'editline' && $lineid == $objp->dispatchlineid)
{ {
print '<input style="width: 50px;" type="number" min="1" name="qty" value="' . $objp->qty . '" />'; print '<input style="width: 50px;" type="number" min="1" name="qty" value="'.$objp->qty.'" />';
} }
else { else {
print $objp->qty; print $objp->qty;
@ -1227,9 +1227,9 @@ if ($id > 0 || !empty($ref)) {
if ($action == 'editline' && $lineid == $objp->dispatchlineid) if ($action == 'editline' && $lineid == $objp->dispatchlineid)
{ {
if (count($listwarehouses) > 1) { if (count($listwarehouses) > 1) {
print $formproduct->selectWarehouses(GETPOST("fk_entrepot")?GETPOST("fk_entrepot"):($objp->warehouse_id?$objp->warehouse_id:''), "fk_entrepot", '', 1, 0, $objp->fk_product, '', 1, 1, null, 'csswarehouse'); print $formproduct->selectWarehouses(GETPOST("fk_entrepot") ?GETPOST("fk_entrepot") : ($objp->warehouse_id ? $objp->warehouse_id : ''), "fk_entrepot", '', 1, 0, $objp->fk_product, '', 1, 1, null, 'csswarehouse');
} elseif (count($listwarehouses) == 1) { } elseif (count($listwarehouses) == 1) {
print $formproduct->selectWarehouses(GETPOST("fk_entrepot")?GETPOST("fk_entrepot"):($objp->warehouse_id?$objp->warehouse_id:''), "fk_entrepot", '', 0, 0, $objp->fk_product, '', 1, 1, null, 'csswarehouse'); print $formproduct->selectWarehouses(GETPOST("fk_entrepot") ?GETPOST("fk_entrepot") : ($objp->warehouse_id ? $objp->warehouse_id : ''), "fk_entrepot", '', 0, 0, $objp->fk_product, '', 1, 1, null, 'csswarehouse');
} else { } else {
$langs->load("errors"); $langs->load("errors");
print $langs->trans("ErrorNoWarehouseDefined"); print $langs->trans("ErrorNoWarehouseDefined");
@ -1293,13 +1293,13 @@ if ($id > 0 || !empty($ref)) {
if ($action != 'editline' || $lineid != $objp->dispatchlineid) if ($action != 'editline' || $lineid != $objp->dispatchlineid)
{ {
print '<td class="linecoledit center">'; print '<td class="linecoledit center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;lineid=' . $objp->dispatchlineid .'#line_'. $objp->dispatchlineid . '">'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;lineid='.$objp->dispatchlineid.'#line_'.$objp->dispatchlineid.'">';
print img_edit(); print img_edit();
print '</a>'; print '</a>';
print '</td>'; print '</td>';
print '<td class="linecoldelete center">'; print '<td class="linecoldelete center">';
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=ask_deleteline&amp;lineid=' . $objp->dispatchlineid . '#dispatch_received_products">'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=ask_deleteline&amp;lineid='.$objp->dispatchlineid.'#dispatch_received_products">';
print img_delete(); print img_delete();
print '</a>'; print '</a>';
print '</td>'; print '</td>';
@ -1309,7 +1309,7 @@ if ($id > 0 || !empty($ref)) {
print '<input type="submit" class="button" id="savelinebutton" name="save" value="'.$langs->trans("Save").'" />'; print '<input type="submit" class="button" id="savelinebutton" name="save" value="'.$langs->trans("Save").'" />';
print '</td>'; print '</td>';
print '<td class="center valignmiddle">'; print '<td class="center valignmiddle">';
print '<input type="submit" class="button" id="cancellinebutton" name="cancel" value="'. $langs->trans("Cancel").'" />'; print '<input type="submit" class="button" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'" />';
print '</td>'; print '</td>';
} }

Some files were not shown because too many files have changed in this diff Show More