Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into new_choose_lines_from_origin

This commit is contained in:
Maxime Kohlhaas 2019-07-27 10:53:43 +02:00
commit 5c2763d0dd
704 changed files with 9047 additions and 5855 deletions

View File

@ -113,13 +113,14 @@ Also, some code changes need a prior approbation:
* if you add a new table, you must first create a page on http://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Than ask the project manager (@eldy) if the new data model you plan to add can be accepted as you suggest. * if you add a new table, you must first create a page on http://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Than ask the project manager (@eldy) if the new data model you plan to add can be accepted as you suggest.
Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow every developer discuss about the PR.
every developer discuss about the PR.
If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration.
If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR.
By putting your mouse on the tag, you will get a full explanation of the tag/status that explain why your PR has not been integrated yet. If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR and why the PR is kept open. By putting your mouse on the tag, you will get a full explanation of the tag/status that explain why your PR has not been integrated yet.
Around 95% of submitted PR are reviewed and tagged. Even if this is one of the most important ratio in Open Source world, don't expect the core team In most cases, it give you information of things you have to do to have the PR taken into consideration (for example a change is requested, a conflict is expected to be solved, some questions were asked). If you have a yellow, red flag of purple flag, don't expect to have your PR validated. You must first provide the answer the flag ask you. The majority of PR are waiting a developer action.
to reach the 100%. With the increasing popularity of Dolibarr, this ratio will probably decrease in future.
Around 95% of submitted PR are reviewed and tagged. Even if this is one of the most important ratio of answered PR in Open Source world, don't expect the core team to reach the 100%. With the increasing popularity of Dolibarr, this ratio will probably decrease in future.
### Resources ### Resources

View File

@ -1,6 +1,6 @@
# .scrutinizer.yml # .scrutinizer.yml
build: #build:
- php-scrutinizer-run # - php-scrutinizer-run
imports: imports:
- javascript - javascript

View File

@ -14,7 +14,7 @@ WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Properties ->libelle_incoterms were renamed into ->label_incoterms * Properties ->libelle_incoterms were renamed into ->label_incoterms
* Removed the method liste_array() of project class. It was not used by core code.
***** ChangeLog for 10.0.0 compared to 9.0.0 ***** ***** ChangeLog for 10.0.0 compared to 9.0.0 *****
@ -414,7 +414,7 @@ NEW: add option PROPOSAL_AUTO_ADD_AUTHOR_AS_CONTACT
NEW: Add option to display thirdparty adress in combolist NEW: Add option to display thirdparty adress in combolist
NEW: Add option to swap sender/recipient address on PDF NEW: Add option to swap sender/recipient address on PDF
NEW: Add option to display thirdparty adress in combolist NEW: Add option to display thirdparty adress in combolist
NEW: Add project on pament of salaries NEW: Add project on payment of salaries
NEW: Add SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME and NEW: Add SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME and
NEW: Add somes hooks in bank planned entries NEW: Add somes hooks in bank planned entries
NEW: Add supplier ref in item reception page NEW: Add supplier ref in item reception page

View File

@ -8,7 +8,7 @@ define('DOL_DOCUMENT_ROOT', __DIR__ . '/../../htdocs');
define('DOL_DATA_ROOT', __DIR__ . '/../../documents'); define('DOL_DATA_ROOT', __DIR__ . '/../../documents');
define('DOL_URL_ROOT', '/'); define('DOL_URL_ROOT', '/');
// Load the main.inc.php file to have finctions llx_Header and llx_Footer defined // Load the main.inc.php file to have functions llx_Header and llx_Footer defined
if (! defined("NOLOGIN")) define("NOLOGIN", '1'); if (! defined("NOLOGIN")) define("NOLOGIN", '1');
global $conf, $langs, $user, $db; global $conf, $langs, $user, $db;
include_once __DIR__ . '/../../htdocs/main.inc.php'; include_once __DIR__ . '/../../htdocs/main.inc.php';

View File

@ -27,6 +27,15 @@ With
ESCPOS:
-------
Replace
private $connector;
With
protected $connector;
NUSOAP: NUSOAP:
------- -------
* In file nusoap.php, to avoid a warning, * In file nusoap.php, to avoid a warning,

1
htdocs/.gitignore vendored
View File

@ -28,3 +28,4 @@
/nomenclature* /nomenclature*
/of/ /of/
/workstation/ /workstation/
/oblyon*

View File

@ -162,7 +162,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
{ {
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label'; if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label';
if ($fieldnamekey == 'code') $fieldnamekey = 'Code'; if ($fieldnamekey == 'code') $fieldnamekey = 'Code';
if ($fieldnamekey == 'nature') $fieldnamekey = 'Nature'; if ($fieldnamekey == 'nature') $fieldnamekey = 'NatureOfJournal';
} }
// Other checks // Other checks
if (isset($_POST["code"])) if (isset($_POST["code"]))
@ -437,7 +437,7 @@ if ($id)
$valuetoshow=$langs->trans("Label"); $valuetoshow=$langs->trans("Label");
} }
if ($fieldlist[$field]=='nature') { if ($fieldlist[$field]=='nature') {
$valuetoshow=$langs->trans("Nature"); $valuetoshow=$langs->trans("NatureOfJournal");
} }
if ($valuetoshow != '') { if ($valuetoshow != '') {
@ -516,7 +516,7 @@ if ($id)
} }
// Title line with search boxes // Title line with search boxes
print '<tr class="liste_titre_filter liste_titre_add">'; /*print '<tr class="liste_titre_filter liste_titre_add">';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
@ -524,16 +524,14 @@ if ($id)
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre center">'; print '<td class="liste_titre center">';
if ($filterfound) $searchpicto=$form->showFilterButtons();
{
$searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
}
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
*/
// Title of lines // Title of lines
print '<tr class="liste_titre">'; print '<tr class="liste_titre liste_titre_add">';
foreach ($fieldlist as $field => $value) foreach ($fieldlist as $field => $value)
{ {
// Determine le nom du champ par rapport aux noms possibles // Determine le nom du champ par rapport aux noms possibles
@ -558,7 +556,7 @@ if ($id)
$valuetoshow=$langs->trans("Label"); $valuetoshow=$langs->trans("Label");
} }
if ($fieldlist[$field]=='nature') { if ($fieldlist[$field]=='nature') {
$valuetoshow=$langs->trans("Nature"); $valuetoshow=$langs->trans("NatureOfJournal");
} }
// Affiche nom du champ // Affiche nom du champ

View File

@ -462,7 +462,7 @@ if ($result)
// print '<td class="left">' . $obj->description . '</td>'; // print '<td class="left">' . $obj->description . '</td>';
// TODO: we shoul set a user defined value to adjust user square / wide screen size // TODO: we shoul set a user defined value to adjust user square / wide screen size
$trunclengh = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; $trunclengh = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>'; print '<td>' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
} }
if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT')

View File

@ -321,8 +321,8 @@ class BookKeeping extends CommonObject
$sql .= ", piece_num"; $sql .= ", piece_num";
$sql .= ', entity'; $sql .= ', entity';
$sql .= ") VALUES ("; $sql .= ") VALUES (";
$sql .= "'" . $this->db->idate($this->doc_date) . "'"; $sql .= "'".$this->db->idate($this->doc_date)."'";
$sql .= ", ".(! isset($this->date_lim_reglement) || dol_strlen($this->date_lim_reglement) == 0 ? 'NULL' : "'" . $this->db->idate($this->date_lim_reglement) . "'"); $sql .= ", ".(! isset($this->date_lim_reglement) || dol_strlen($this->date_lim_reglement) == 0 ? 'NULL' : "'".$this->db->idate($this->date_lim_reglement)."'");
$sql .= ",'" . $this->db->escape($this->doc_type) . "'"; $sql .= ",'" . $this->db->escape($this->doc_type) . "'";
$sql .= ",'" . $this->db->escape($this->doc_ref) . "'"; $sql .= ",'" . $this->db->escape($this->doc_ref) . "'";
$sql .= "," . $this->fk_doc; $sql .= "," . $this->fk_doc;
@ -338,7 +338,7 @@ class BookKeeping extends CommonObject
$sql .= "," . $this->montant; $sql .= "," . $this->montant;
$sql .= ",'" . $this->db->escape($this->sens) . "'"; $sql .= ",'" . $this->db->escape($this->sens) . "'";
$sql .= ",'" . $this->db->escape($this->fk_user_author) . "'"; $sql .= ",'" . $this->db->escape($this->fk_user_author) . "'";
$sql .= ",'" . $this->db->idate($now). "'"; $sql .= ",'".$this->db->idate($now)."'";
$sql .= ",'" . $this->db->escape($this->code_journal) . "'"; $sql .= ",'" . $this->db->escape($this->code_journal) . "'";
$sql .= ",'" . $this->db->escape($this->journal_label) . "'"; $sql .= ",'" . $this->db->escape($this->journal_label) . "'";
$sql .= "," . $this->db->escape($this->piece_num); $sql .= "," . $this->db->escape($this->piece_num);
@ -543,7 +543,7 @@ class BookKeeping extends CommonObject
// Put here code to add control on parameters values // Put here code to add control on parameters values
// Insert request // Insert request
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . $mode.'('; $sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . $mode.' (';
$sql .= 'doc_date,'; $sql .= 'doc_date,';
$sql .= 'date_lim_reglement,'; $sql .= 'date_lim_reglement,';
$sql .= 'doc_type,'; $sql .= 'doc_type,';
@ -567,7 +567,7 @@ class BookKeeping extends CommonObject
$sql .= 'piece_num,'; $sql .= 'piece_num,';
$sql .= 'entity'; $sql .= 'entity';
$sql .= ') VALUES ('; $sql .= ') VALUES (';
$sql .= ' ' . (! isset($this->doc_date) || dol_strlen($this->doc_date) == 0 ? 'NULL' : "'" . $this->db->idate($this->doc_date) . "'") . ','; $sql .= ' ' . (! isset($this->doc_date) || dol_strlen($this->doc_date) == 0 ? 'NULL' : "'".$this->db->idate($this->doc_date)."'") . ',';
$sql .= ' ' . (! isset($this->date_lim_reglement) || dol_strlen($this->date_lim_reglement) == 0 ? 'NULL' : "'" . $this->db->idate($this->date_lim_reglement) . "'") . ','; $sql .= ' ' . (! isset($this->date_lim_reglement) || dol_strlen($this->date_lim_reglement) == 0 ? 'NULL' : "'" . $this->db->idate($this->date_lim_reglement) . "'") . ',';
$sql .= ' ' . (! isset($this->doc_type) ? 'NULL' : "'" . $this->db->escape($this->doc_type) . "'") . ','; $sql .= ' ' . (! isset($this->doc_type) ? 'NULL' : "'" . $this->db->escape($this->doc_type) . "'") . ',';
$sql .= ' ' . (! isset($this->doc_ref) ? 'NULL' : "'" . $this->db->escape($this->doc_ref) . "'") . ','; $sql .= ' ' . (! isset($this->doc_ref) ? 'NULL' : "'" . $this->db->escape($this->doc_ref) . "'") . ',';
@ -584,7 +584,7 @@ class BookKeeping extends CommonObject
$sql .= ' ' . (! isset($this->montant) ? 'NULL' : $this->montant ). ','; $sql .= ' ' . (! isset($this->montant) ? 'NULL' : $this->montant ). ',';
$sql .= ' ' . (! isset($this->sens) ? 'NULL' : "'" . $this->db->escape($this->sens) . "'") . ','; $sql .= ' ' . (! isset($this->sens) ? 'NULL' : "'" . $this->db->escape($this->sens) . "'") . ',';
$sql .= ' ' . $user->id . ','; $sql .= ' ' . $user->id . ',';
$sql .= ' ' . "'" . $this->db->idate($now) . "',"; $sql .= ' ' . "'".$this->db->idate($now)."',";
$sql .= ' ' . (empty($this->code_journal) ? 'NULL' : "'" . $this->db->escape($this->code_journal) . "'") . ','; $sql .= ' ' . (empty($this->code_journal) ? 'NULL' : "'" . $this->db->escape($this->code_journal) . "'") . ',';
$sql .= ' ' . (empty($this->journal_label) ? 'NULL' : "'" . $this->db->escape($this->journal_label) . "'") . ','; $sql .= ' ' . (empty($this->journal_label) ? 'NULL' : "'" . $this->db->escape($this->journal_label) . "'") . ',';
$sql .= ' ' . (empty($this->piece_num) ? 'NULL' : $this->db->escape($this->piece_num)).','; $sql .= ' ' . (empty($this->piece_num) ? 'NULL' : $this->db->escape($this->piece_num)).',';
@ -1161,7 +1161,7 @@ class BookKeeping extends CommonObject
// Update request // Update request
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . $mode.' SET'; $sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . $mode.' SET';
$sql .= ' doc_date = ' . (! isset($this->doc_date) || dol_strlen($this->doc_date) != 0 ? "'" . $this->db->idate($this->doc_date) . "'" : 'null') . ','; $sql .= ' doc_date = ' . (! isset($this->doc_date) || dol_strlen($this->doc_date) != 0 ? "'".$this->db->idate($this->doc_date)."'" : 'null') . ',';
$sql .= ' doc_type = ' . (isset($this->doc_type) ? "'" . $this->db->escape($this->doc_type) . "'" : "null") . ','; $sql .= ' doc_type = ' . (isset($this->doc_type) ? "'" . $this->db->escape($this->doc_type) . "'" : "null") . ',';
$sql .= ' doc_ref = ' . (isset($this->doc_ref) ? "'" . $this->db->escape($this->doc_ref) . "'" : "null") . ','; $sql .= ' doc_ref = ' . (isset($this->doc_ref) ? "'" . $this->db->escape($this->doc_ref) . "'" : "null") . ',';
$sql .= ' fk_doc = ' . (isset($this->fk_doc) ? $this->fk_doc : "null") . ','; $sql .= ' fk_doc = ' . (isset($this->fk_doc) ? $this->fk_doc : "null") . ',';
@ -1692,25 +1692,27 @@ class BookKeeping extends CommonObject
if ($direction==0) if ($direction==0)
{ {
$next_piecenum=$this->getNextNumMvt(); $next_piecenum=$this->getNextNumMvt();
$now = dol_now();
if ($next_piecenum < 0) { if ($next_piecenum < 0) {
$error++; $error++;
} }
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element.'(doc_date, doc_type,'; $sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . ' (doc_date, doc_type,';
$sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,'; $sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,';
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; $sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num)'; $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num, date_creation)';
$sql .= 'SELECT doc_date, doc_type,'; $sql .= ' SELECT doc_date, doc_type,';
$sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,'; $sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,';
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; $sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.$next_piecenum.''; $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, ' . $next_piecenum . ", '".$this->db->idate($now)."'";
$sql .= ' FROM '.MAIN_DB_PREFIX . $this->table_element.'_tmp WHERE piece_num = '.$piece_num; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . '_tmp WHERE piece_num = ' . $this->db->escape($piece_num);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { if (! $resql) {
$error ++; $error ++;
$this->errors[] = 'Error ' . $this->db->lasterror(); $this->errors[] = 'Error ' . $this->db->lasterror();
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
} }
$sql = 'DELETE FROM '.MAIN_DB_PREFIX . $this->table_element.'_tmp WHERE piece_num = '.$piece_num; $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element . '_tmp WHERE piece_num = ' . $this->db->escape($piece_num);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { if (! $resql) {
$error ++; $error ++;
@ -1718,29 +1720,29 @@ class BookKeeping extends CommonObject
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
} }
} elseif ($direction==1) { } elseif ($direction==1) {
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element.'_tmp WHERE piece_num = '.$piece_num; $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element . '_tmp WHERE piece_num = ' . $piece_num;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { if (! $resql) {
$error ++; $error ++;
$this->errors[] = 'Error ' . $this->db->lasterror(); $this->errors[] = 'Error ' . $this->db->lasterror();
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
} }
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element.'_tmp(doc_date, doc_type,'; $sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '_tmp (doc_date, doc_type,';
$sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,'; $sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; $sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num)'; $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num)';
$sql .= 'SELECT doc_date, doc_type,'; $sql .= ' SELECT doc_date, doc_type,';
$sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,'; $sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; $sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num'; $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num';
$sql .= ' FROM '.MAIN_DB_PREFIX . $this->table_element.' WHERE piece_num = '.$piece_num; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element.' WHERE piece_num = ' . $piece_num;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { if (! $resql) {
$error ++; $error ++;
$this->errors[] = 'Error ' . $this->db->lasterror(); $this->errors[] = 'Error ' . $this->db->lasterror();
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
} }
$sql = 'DELETE FROM '.MAIN_DB_PREFIX . $this->table_element.'_tmp WHERE piece_num = '.$piece_num; $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element . '_tmp WHERE piece_num = ' . $piece_num;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { if (! $resql) {
$error ++; $error ++;

View File

@ -374,9 +374,9 @@ if ($result) {
// Ref Product // Ref Product
print '<td>'; print '<td>';
if ($product_static->id) if ($product_static->id > 0) print $product_static->getNomUrl(1);
print $product_static->getNomUrl(1); if ($product_static->id > 0 && $objp->product_label) print '<br>';
if ($objp->product_label) print '<br>'.$objp->product_label; if ($objp->product_label) print $objp->product_label;
print '</td>'; print '</td>';
print '<td class="tdoverflowonsmartphone">'; print '<td class="tdoverflowonsmartphone">';

View File

@ -319,8 +319,8 @@ if ($result) {
$arrayofselected=is_array($toselect)?$toselect:array(); $arrayofselected=is_array($toselect)?$toselect:array();
$param=''; $param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($search_lineid) $param.='&search_lineid='.urlencode($search_lineid); if ($search_lineid) $param.='&search_lineid='.urlencode($search_lineid);
if ($search_day) $param.='&search_day='.urlencode($search_day); if ($search_day) $param.='&search_day='.urlencode($search_day);
if ($search_month) $param.='&search_month='.urlencode($search_month); if ($search_month) $param.='&search_month='.urlencode($search_month);
@ -330,8 +330,8 @@ if ($result) {
if ($search_desc) $param.='&search_desc='.urlencode($search_desc); if ($search_desc) $param.='&search_desc='.urlencode($search_desc);
if ($search_amount) $param.='&search_amount='.urlencode($search_amount); if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
if ($search_vat) $param.='&search_vat='.urlencode($search_vat); if ($search_vat) $param.='&search_vat='.urlencode($search_vat);
if ($search_country) $param .= "&search_country=" . urlencode($search_country); if ($search_country) $param.= "&search_country=".urlencode($search_country);
if ($search_tvaintra) $param .= "&search_tvaintra=" . urlencode($search_tvaintra); if ($search_tvaintra) $param.= "&search_tvaintra=".urlencode($search_tvaintra);
$arrayofmassactions = array( $arrayofmassactions = array(
'ventil'=>$langs->trans("Ventilate") 'ventil'=>$langs->trans("Ventilate")
@ -403,7 +403,7 @@ if ($result) {
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 '); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);

View File

@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT . '/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT . '/don/class/don.class.php';
require_once DOL_DOCUMENT_ROOT . '/don/class/paymentdonation.class.php'; require_once DOL_DOCUMENT_ROOT . '/don/class/paymentdonation.class.php';
require_once DOL_DOCUMENT_ROOT . '/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT . '/compta/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT . '/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php';
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
@ -964,7 +964,7 @@ if (empty($action) || $action == 'view') {
$varlink = 'id_journal=' . $id_journal; $varlink = 'id_journal=' . $id_journal;
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
// Test that setup is complete // Test that setup is complete

View File

@ -384,9 +384,9 @@ if ($result) {
// Ref product // Ref product
print '<td>'; print '<td>';
if ($product_static->id) if ($product_static->id > 0) print $product_static->getNomUrl(1);
print $product_static->getNomUrl(1); if ($product_static->id > 0 && $objp->product_label) print '<br>';
if ($objp->product_label) print '<br>'.$objp->product_label; if ($objp->product_label) print $objp->product_label;
print '</td>'; print '</td>';
// Description // Description

View File

@ -405,7 +405,7 @@ if ($result) {
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 '); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);

View File

@ -653,7 +653,7 @@ if (empty($reshook))
if (empty($labeltouse) || (int) $labeltouse === -1) { if (empty($labeltouse) || (int) $labeltouse === -1) {
//fallback on the old configuration. //fallback on the old configuration.
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors'); setEventMessages('WarningMandatorySetupNotComplete', null, 'errors');
$error++; $error++;
} }
else { else {
@ -734,7 +734,7 @@ if (empty($reshook))
if (empty($labeltouse) || (int) $labeltouse === -1) { if (empty($labeltouse) || (int) $labeltouse === -1) {
//fallback on the old configuration. //fallback on the old configuration.
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors'); setEventMessages('WarningMandatorySetupNotComplete', null, 'errors');
$error++; $error++;
} }
else { else {

View File

@ -2439,6 +2439,7 @@ class Adherent extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
* *
@ -2448,7 +2449,7 @@ class Adherent extends CommonObject
* 2=Return key only (uid=qqq) * 2=Return key only (uid=qqq)
* @return string DN * @return string DN
*/ */
private function _load_ldap_dn($info, $mode = 0) public function _load_ldap_dn($info, $mode = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;

View File

@ -229,7 +229,7 @@ if ($search_type) $param.="&search_type=".urlencode($search_type);
if ($date_select) $param.="&date_select=".urlencode($date_select); if ($date_select) $param.="&date_select=".urlencode($date_select);
if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname); if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname);
if ($search_login) $param.="&search_login=".urlencode($search_login); if ($search_login) $param.="&search_login=".urlencode($search_login);
if ($search_acount) $param.="&search_account=".urlencode($search_account); if ($search_account) $param.="&search_account=".urlencode($search_account);
if ($search_amount) $param.="&search_amount=".urlencode($search_amount); if ($search_amount) $param.="&search_amount=".urlencode($search_amount);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
// Add $param from extra fields // Add $param from extra fields

View File

@ -40,7 +40,7 @@ $cancel = GETPOST('cancel', 'alpha');
$search_event = GETPOST('search_event', 'alpha'); $search_event = GETPOST('search_event', 'alpha');
// Get list of triggers available // Get list of triggers available
$sql = "SELECT a.rowid, a.code, a.label, a.elementtype"; $sql = "SELECT a.rowid, a.code, a.label, a.elementtype, a.rang as position";
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a"; $sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a";
$sql.= " ORDER BY a.rang ASC"; $sql.= " ORDER BY a.rang ASC";
$resql=$db->query($sql); $resql=$db->query($sql);
@ -55,6 +55,7 @@ if ($resql)
$triggers[$i]['code'] = $obj->code; $triggers[$i]['code'] = $obj->code;
$triggers[$i]['element'] = $obj->elementtype; $triggers[$i]['element'] = $obj->elementtype;
$triggers[$i]['label'] = ($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label); $triggers[$i]['label'] = ($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
$triggers[$i]['position'] = $obj->position;
$i++; $i++;
} }
@ -65,6 +66,8 @@ else
dol_print_error($db); dol_print_error($db);
} }
//$triggers = dol_sort_array($triggers, 'code', 'asc', 0, 0, 1);
/* /*
* Actions * Actions

View File

@ -1622,7 +1622,11 @@ if ($id)
elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
} }
if ($id == 25 && in_array($obj->code, array('banner', 'blogpost', 'other', 'page')))
{
$iserasable = 0; $canbedisabled = 0;
if (in_array($obj->code, array('banner'))) $canbedisabled = 1;
}
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; } if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; }
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $canbedisabled=0; $canbedisabled = 0; } if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $canbedisabled=0; $canbedisabled = 0; }
$canbemodified=$iserasable; $canbemodified=$iserasable;

View File

@ -201,6 +201,7 @@ dol_fiche_head($head, 'holiday', $langs->trans("Holidays"), -1, 'holiday');
print load_fiche_titre($langs->trans("HolidaysNumberingModules"), '', ''); print load_fiche_titre($langs->trans("HolidaysNumberingModules"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="100">'.$langs->trans("Name").'</td>'; print '<td width="100">'.$langs->trans("Name").'</td>';
@ -294,8 +295,10 @@ foreach ($dirmodels as $reldir)
} }
} }
print '</table><br>'; print '</table>';
print '</div>';
print '<br>';
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
@ -331,6 +334,7 @@ else
} }
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>'; print '<td>'.$langs->trans("Name").'</td>';
@ -457,6 +461,7 @@ foreach ($dirmodels as $reldir)
} }
print '</table>'; print '</table>';
print '</div>';
print "<br>"; print "<br>";
@ -469,6 +474,8 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_other">'; print '<input type="hidden" name="action" value="set_other">';
print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>'; print '<td>'.$langs->trans("Parameter").'</td>';
@ -506,6 +513,8 @@ print '<input size="50" class="flat" type="text" name="HOLIDAY_DRAFT_WATERMARK"
print '</td></tr>'."\n"; print '</td></tr>'."\n";
print '</table>'; print '</table>';
print '</div>';
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';

View File

@ -60,6 +60,7 @@ if (GETPOST('cancel', 'alpha'))
if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACKGROUND)) if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACKGROUND))
{ {
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity);
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$logofile=$conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND; $logofile=$conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND;
@ -81,6 +82,7 @@ if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACK
if ($action == 'update') if ($action == 'update')
{ {
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"], 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"], 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"], 'chaine', 0, '', $conf->entity);

View File

@ -526,11 +526,17 @@ else
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
// Disable // Disable
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_MAILS").'</td><td>'.yn($conf->global->MAIN_DISABLE_ALL_MAILS).'</td></tr>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_MAILS").'</td><td>'.yn($conf->global->MAIN_DISABLE_ALL_MAILS);
if (! empty($conf->global->MAIN_DISABLE_ALL_MAILS)) print img_warning($langs->trans("Disabled"));
print '</td></tr>';
// Force e-mail recipient // Force e-mail recipient
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").'</td><td>'.$conf->global->MAIN_MAIL_FORCE_SENDTO; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").'</td><td>'.$conf->global->MAIN_MAIL_FORCE_SENDTO;
if (! empty($conf->global->MAIN_MAIL_FORCE_SENDTO) && ! isValidEmail($conf->global->MAIN_MAIL_FORCE_SENDTO)) print img_warning($langs->trans("ErrorBadEMail")); if (! empty($conf->global->MAIN_MAIL_FORCE_SENDTO))
{
if (! isValidEmail($conf->global->MAIN_MAIL_FORCE_SENDTO)) print img_warning($langs->trans("ErrorBadEMail"));
else print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue"));
}
print '</td></tr>'; print '</td></tr>';
//Add user to select destinaries list //Add user to select destinaries list

View File

@ -87,7 +87,8 @@ if ($action == 'update')
$result=$menu->fetch(GETPOST('menuId', 'int')); $result=$menu->fetch(GETPOST('menuId', 'int'));
if ($result > 0) if ($result > 0)
{ {
$menu->titre=GETPOST('titre', 'alpha'); $menu->titre=GETPOST('titre', 'alpha'); // deprecated
$menu->title=GETPOST('titre', 'alpha');
$menu->leftmenu=GETPOST('leftmenu', 'aZ09'); $menu->leftmenu=GETPOST('leftmenu', 'aZ09');
$menu->url=GETPOST('url', 'alpha'); $menu->url=GETPOST('url', 'alpha');
$menu->langs=GETPOST('langs', 'alpha'); $menu->langs=GETPOST('langs', 'alpha');
@ -205,7 +206,8 @@ if ($action == 'add')
$menu = new Menubase($db); $menu = new Menubase($db);
$menu->menu_handler=preg_replace('/_menu$/', '', GETPOST('menu_handler', 'aZ09')); $menu->menu_handler=preg_replace('/_menu$/', '', GETPOST('menu_handler', 'aZ09'));
$menu->type=GETPOST('type', 'alpha'); $menu->type=GETPOST('type', 'alpha');
$menu->titre=GETPOST('titre', 'alpha'); $menu->titre=GETPOST('titre', 'alpha'); // deprecated
$menu->title=GETPOST('titre', 'alpha');
$menu->url=GETPOST('url', 'alpha'); $menu->url=GETPOST('url', 'alpha');
$menu->langs=GETPOST('langs', 'alpha'); $menu->langs=GETPOST('langs', 'alpha');
$menu->position=GETPOST('position', 'int'); $menu->position=GETPOST('position', 'int');
@ -494,7 +496,7 @@ elseif ($action == 'edit')
//print '<tr><td>'.$langs->trans('Level').'</td><td>'.$menu->level.'</td><td>'.$langs->trans('DetailLevel').'</td></tr>'; //print '<tr><td>'.$langs->trans('Level').'</td><td>'.$menu->level.'</td><td>'.$langs->trans('DetailLevel').'</td></tr>';
// Title // Title
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" class="minwidth300" name="titre" value="'.dol_escape_htmltag($menu->titre).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" class="minwidth300" name="titre" value="'.dol_escape_htmltag($menu->titre ? $menu->titre : $menu->title).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
// Url // Url
print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" class="quatrevingtpercent" name="url" value="'.$menu->url.'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" class="quatrevingtpercent" name="url" value="'.$menu->url.'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';

View File

@ -244,13 +244,13 @@ print "<br>\n";
// Confirmation for remove menu entry // Confirmation for remove menu entry
if ($action == 'delete') if ($action == 'delete')
{ {
$sql = "SELECT m.titre"; $sql = "SELECT m.titre as title";
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m";
$sql.= " WHERE m.rowid = ".GETPOST('menuId', 'int'); $sql.= " WHERE m.rowid = ".GETPOST('menuId', 'int');
$result = $db->query($sql); $result = $db->query($sql);
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOST('menuId', 'int'), $langs->trans("DeleteMenu"), $langs->trans("ConfirmDeleteMenu", $obj->titre), "confirm_delete"); print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOST('menuId', 'int'), $langs->trans("DeleteMenu"), $langs->trans("ConfirmDeleteMenu", $obj->title), "confirm_delete");
} }
$newcardbutton=''; $newcardbutton='';

View File

@ -900,7 +900,8 @@ if ($mode == 'marketplace')
?> ?>
<form method="POST" class="centpercent" id="searchFormList" action="<?php echo $dolistore->url ?>"> <form method="POST" class="centpercent" id="searchFormList" action="<?php echo $dolistore->url ?>">
<input type="hidden" name="mode" value="marketplace" /> <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken'] ?>">
<input type="hidden" name="mode" value="marketplace">
<div class="divsearchfield"><?php echo $langs->trans('Keyword') ?>: <div class="divsearchfield"><?php echo $langs->trans('Keyword') ?>:
<input name="search_keyword" placeholder="<?php echo $langs->trans('Chercher un module') ?>" id="search_keyword" type="text" size="50" value="<?php echo $options['search'] ?>"><br> <input name="search_keyword" placeholder="<?php echo $langs->trans('Chercher un module') ?>" id="search_keyword" type="text" size="50" value="<?php echo $options['search'] ?>"><br>
</div> </div>
@ -1026,15 +1027,35 @@ if ($mode == 'deploy')
print $langs->trans("YouCanSubmitFile"); print $langs->trans("YouCanSubmitFile");
$max=$conf->global->MAIN_UPLOAD_DOC; // En Kb $max=$conf->global->MAIN_UPLOAD_DOC; // In Kb
$maxphp=@ini_get('upload_max_filesize'); // En inconnu $maxphp=@ini_get('upload_max_filesize'); // In unknown
if (preg_match('/k$/i', $maxphp)) $maxphp=$maxphp*1; if (preg_match('/k$/i', $maxphp)) $maxphp=$maxphp*1;
if (preg_match('/m$/i', $maxphp)) $maxphp=$maxphp*1024; if (preg_match('/m$/i', $maxphp)) $maxphp=$maxphp*1024;
if (preg_match('/g$/i', $maxphp)) $maxphp=$maxphp*1024*1024; if (preg_match('/g$/i', $maxphp)) $maxphp=$maxphp*1024*1024;
if (preg_match('/t$/i', $maxphp)) $maxphp=$maxphp*1024*1024*1024; if (preg_match('/t$/i', $maxphp)) $maxphp=$maxphp*1024*1024*1024;
// Now $max and $maxphp are in Kb $maxphp2=@ini_get('post_max_size'); // In unknown
if (preg_match('/k$/i', $maxphp2)) $maxphp2=$maxphp2*1;
if (preg_match('/m$/i', $maxphp2)) $maxphp2=$maxphp2*1024;
if (preg_match('/g$/i', $maxphp2)) $maxphp2=$maxphp2*1024*1024;
if (preg_match('/t$/i', $maxphp2)) $maxphp2=$maxphp2*1024*1024*1024;
// Now $max and $maxphp and $maxphp2 are in Kb
$maxmin = $max; $maxmin = $max;
if ($maxphp > 0) $maxmin=min($max, $maxphp); $maxphptoshow = $maxphptoshowparam = '';
if ($maxphp > 0)
{
$maxmin=min($max, $maxphp);
$maxphptoshow = $maxphp;
$maxphptoshowparam = 'upload_max_filesize';
}
if ($maxphp2 > 0)
{
$maxmin=min($max, $maxphp2);
if ($maxphp2 < $maxphp)
{
$maxphptoshow = $maxphp2;
$maxphptoshowparam = 'post_max_size';
}
}
if ($maxmin > 0) if ($maxmin > 0)
{ {
@ -1062,7 +1083,7 @@ if ($mode == 'deploy')
{ {
$langs->load('other'); $langs->load('other');
print ' '; print ' ';
print info_admin($langs->trans("ThisLimitIsDefinedInSetup", $max, $maxphp), 1); print info_admin($langs->trans("ThisLimitIsDefinedInSetup", $max, $maxphptoshow, $maxphptoshowparam), 1);
} }
} }
else else

View File

@ -220,7 +220,7 @@ print load_fiche_titre($langs->trans("SupplierProposalSetup"), $linkback, 'title
$head = supplier_proposal_admin_prepare_head(); $head = supplier_proposal_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("CommRequests"), 0, 'supplier_proposal'); dol_fiche_head($head, 'general', $langs->trans("CommRequests"), -1, 'supplier_proposal');
/* /*
* Module numerotation * Module numerotation

View File

@ -70,6 +70,18 @@ else
} }
print '<br>'; print '<br>';
// Module log
print '<br>';
print '<strong>'.$langs->trans("Syslog").'</strong>: ';
$test=empty($conf->syslog->enabled);
if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled");
else
{
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("Syslog"));
//print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
}
print '<br>';
// Module debugbar // Module debugbar
print '<br>'; print '<br>';
print '<strong>'.$langs->trans("DebugBar").'</strong>: '; print '<strong>'.$langs->trans("DebugBar").'</strong>: ';
@ -77,7 +89,7 @@ $test=empty($conf->debugbar->enabled);
if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled");
else else
{ {
print img_picto('', 'warning').' '.$langs->trans("DebugBarModuleActivated"); print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("DebugBar"));
//print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>'; //print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
} }
print '<br>'; print '<br>';
@ -110,20 +122,20 @@ $test=function_exists('xcache_info');
if (! $foundcache && $test) if (! $foundcache && $test)
{ {
$foundcache++; $foundcache++;
print img_picto('', 'tick.png').' '.$langs->trans("XCacheInstalled"); print img_picto('', 'tick.png').' '.$langs->trans("PHPModuleLoaded", "XCache");
print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xcache.php'.'">Xcache admin page</a>'; print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xcache.php'.'">Xcache admin page</a>';
} }
$test=function_exists('eaccelerator_info'); $test=function_exists('eaccelerator_info');
if (! $foundcache && $test) if (! $foundcache && $test)
{ {
$foundcache++; $foundcache++;
print img_picto('', 'tick.png').' '.$langs->trans("EAcceleratorInstalled"); print img_picto('', 'tick.png').' '.$langs->trans("PHPModuleLoaded", "Eaccelerator");
} }
$test=function_exists('opcache_get_status'); $test=function_exists('opcache_get_status');
if (! $foundcache && $test) if (! $foundcache && $test)
{ {
$foundcache++; $foundcache++;
print img_picto('', 'tick.png').' '.$langs->trans("ZendOPCacheInstalled"); // Should be by default starting with PHP 5.5 print img_picto('', 'tick.png').' '.$langs->trans("PHPModuleLoaded", "ZendOPCache"); // Should be by default starting with PHP 5.5
//$tmp=opcache_get_status(); //$tmp=opcache_get_status();
//var_dump($tmp); //var_dump($tmp);
} }
@ -144,6 +156,21 @@ if (! $foundcache && $test)
if (! $foundcache) print $langs->trans("NoOPCodeCacheFound"); if (! $foundcache) print $langs->trans("NoOPCodeCacheFound");
print '<br>'; print '<br>';
// Use of preload bootstrap
if (ini_get('opcache.preload'))
{
print '<br>';
print '<strong>'.$langs->trans("PreloadOPCode").'</strong>: ';
print ini_get('opcache.preload');
}
else
{
print '<br>';
print '<strong>'.$langs->trans("PreloadOPCode").'</strong>: ';
print $langs->trans("No");
}
print '<br>';
// HTTPCacheStaticResources // HTTPCacheStaticResources
print '<script type="text/javascript" language="javascript"> print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() { jQuery(document).ready(function() {
@ -467,16 +494,46 @@ if ($resql)
{ {
if (empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) if (empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE))
{ {
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXProductUseSearchOptim", $nb); print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE');
} }
else else
{ {
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXProductAndSearchOptimOn", $nb); print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
} }
} }
else else
{ {
print img_picto('', 'tick.png').' '.$langs->trans("NbOfProductIsLowerThanNoPb", $nb); print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
}
print '<br>';
$db->free($resql);
}
// Thirdparty search
$tab = array();
$sql = "SELECT COUNT(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$resql=$db->query($sql);
if ($resql)
{
$limitforoptim=10000;
$num=$db->num_rows($resql);
$obj=$db->fetch_object($resql);
$nb=$obj->nb;
if ($nb > $limitforoptim)
{
if (empty($conf->global->THIRDPARTY_DONOTSEARCH_ANYWHERE))
{
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'THIRDPARTY_DONOTSEARCH_ANYWHERE');
}
else
{
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
}
}
else
{
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
} }
print '<br>'; print '<br>';
$db->free($resql); $db->free($resql);

View File

@ -48,14 +48,31 @@ if (isset($title))
} }
// Check PHP setup is OK
$maxphp=@ini_get('upload_max_filesize'); // In unknown
if (preg_match('/k$/i', $maxphp)) $maxphp=$maxphp*1;
if (preg_match('/m$/i', $maxphp)) $maxphp=$maxphp*1024;
if (preg_match('/g$/i', $maxphp)) $maxphp=$maxphp*1024*1024;
if (preg_match('/t$/i', $maxphp)) $maxphp=$maxphp*1024*1024*1024;
$maxphp2=@ini_get('post_max_size'); // In unknown
if (preg_match('/k$/i', $maxphp2)) $maxphp2=$maxphp2*1;
if (preg_match('/m$/i', $maxphp2)) $maxphp2=$maxphp2*1024;
if (preg_match('/g$/i', $maxphp2)) $maxphp2=$maxphp2*1024*1024;
if (preg_match('/t$/i', $maxphp2)) $maxphp2=$maxphp2*1024*1024*1024;
if ($maxphp > 0 && $maxphp2 > 0 && $maxphp > $maxphp2)
{
$langs->load("errors");
print info_admin($langs->trans("WarningParamUploadMaxFileSizeHigherThanPostMaxSize", @ini_get('upload_max_filesize'), @ini_get('post_max_size')), 0, 0, 0, 'warning');
print '<br>';
}
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print "\n"; print "\n";
$var=false;
// Recupere la version de PHP // Get PHP version
$phpversion=version_php(); $phpversion=version_php();
print '<tr class="oddeven"><td width="220px">'.$langs->trans("Version")."</td><td>".$phpversion."</td></tr>\n"; print '<tr class="oddeven"><td width="220px">'.$langs->trans("Version")."</td><td>".$phpversion."</td></tr>\n";

View File

@ -143,7 +143,6 @@ class DolibarrApi
unset($object->picto); unset($object->picto);
unset($object->fieldsforcombobox); unset($object->fieldsforcombobox);
unset($object->comments);
unset($object->skip_update_total); unset($object->skip_update_total);
unset($object->context); unset($object->context);

View File

@ -88,18 +88,21 @@ if (preg_match('/api\/index\.php\/explorer/', $_SERVER["PHP_SELF"]) && ! empty($
// index.php/xxx called by any REST client to run API // index.php/xxx called by any REST client to run API
$reg=array();
preg_match('/index\.php\/([^\/]+)(.*)$/', $_SERVER["PHP_SELF"], $reg); preg_match('/index\.php\/([^\/]+)(.*)$/', $_SERVER["PHP_SELF"], $reg);
// .../index.php/categories?sortfield=t.rowid&sortorder=ASC // .../index.php/categories?sortfield=t.rowid&sortorder=ASC
// Set the flag to say to refresh (when we reload the explorer, production must be for API call only) // When in production mode, a file api/temp/routes.php is created with the API available of current call.
$refreshcache=false; // But, if we set $refreshcache to false, so it may have only one API in the routes.php file if we make a call for one API without
// using the explorer. And when we make another call for another API, the API is not into the api/temp/routes.php and a 404 is returned.
// So we force refresh to each call.
$refreshcache=(empty($conf->global->API_PRODUCTION_DO_NOT_ALWAYS_REFRESH_CACHE) ? true : false);
if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root'))
{ {
$refreshcache=true; $refreshcache=true;
} }
$api = new DolibarrApi($db, '', $refreshcache); $api = new DolibarrApi($db, '', $refreshcache);
//var_dump($api->r->apiVersionMap); //var_dump($api->r->apiVersionMap);
@ -115,7 +118,7 @@ UploadFormat::$allowedMimeTypes = array('image/jpeg', 'image/png', 'text/plain',
// Call Explorer file for all APIs definitions // Call Explorer file for all APIs definitions (this part is slow)
if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root'))
{ {
// Scan all API files to load them // Scan all API files to load them
@ -254,5 +257,6 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' &&
//var_dump($api->r->apiVersionMap); //var_dump($api->r->apiVersionMap);
//exit; //exit;
// Call API (we suppose we found it) // Call API (we suppose we found it).
// The handle will use the file api/temp/routes.php to get data to run the API. If the file exists and the entry for API is not found, it will return 404.
$api->r->handle(); $api->r->handle();

View File

@ -495,7 +495,7 @@ if (is_array($blocks))
print '<td'.(preg_match('/<a/', $object_link) ? ' class="nowrap"' : '').'><!-- object_link -->'.$object_link.'</td>'; print '<td'.(preg_match('/<a/', $object_link) ? ' class="nowrap"' : '').'><!-- object_link -->'.$object_link.'</td>';
// Amount // Amount
print '<td class="right">'.price($block->amounts).'</td>'; print '<td class="right nowraponall">'.price($block->amounts).'</td>';
// Details link // Details link
print '<td align="center"><a href="#" data-blockid="'.$block->id.'" rel="show-info">'.img_info($langs->trans('ShowDetails')).'</a></td>'; print '<td align="center"><a href="#" data-blockid="'.$block->id.'" rel="show-info">'.img_info($langs->trans('ShowDetails')).'</a></td>';

View File

@ -889,7 +889,7 @@ class BOM extends CommonObject
$this->lines=array(); $this->lines=array();
$objectline = new BOMLine($this->db); $objectline = new BOMLine($this->db);
$result = $objectline->fetchAll('ASC', 'rank', 0, 0, array('customsql'=>'fk_bom = '.$this->id)); $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.$this->id));
if (is_numeric($result)) if (is_numeric($result))
{ {
@ -1044,7 +1044,7 @@ class BOMLine extends CommonObject
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
'qty' => array('type'=>'double(24,8)', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'notnull'=>1, 'isameasure'=>'1',), 'qty' => array('type'=>'double(24,8)', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'notnull'=>1, 'isameasure'=>'1',),
'efficiency' => array('type'=>'double(8,4)', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>110, 'notnull'=>1, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLoss'), 'efficiency' => array('type'=>'double(8,4)', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>110, 'notnull'=>1, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLoss'),
'rank' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'position'=>200, 'notnull'=>1,), 'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'position'=>200, 'notnull'=>1,),
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
); );
public $rowid; public $rowid;
@ -1053,7 +1053,7 @@ class BOMLine extends CommonObject
public $description; public $description;
public $qty; public $qty;
public $efficiency; public $efficiency;
public $rank; public $position;
public $import_key; public $import_key;
// END MODULEBUILDER PROPERTIES // END MODULEBUILDER PROPERTIES

View File

@ -43,7 +43,7 @@ $action=GETPOST('action', 'alpha');
$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'actioncommlist'; // To manage different context of search $contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'actioncommlist'; // To manage different context of search
$resourceid=GETPOST("search_resourceid", "int")?GETPOST("search_resourceid", "int"):GETPOST("resourceid", "int"); $resourceid=GETPOST("search_resourceid", "int")?GETPOST("search_resourceid", "int"):GETPOST("resourceid", "int");
$pid=GETPOST("search_projectid", 'int', 3)?GETPOST("search_projectid", 'int', 3):GETPOST("projectid", 'int', 3); $pid=GETPOST("search_projectid", 'int', 3)?GETPOST("search_projectid", 'int', 3):GETPOST("projectid", 'int', 3);
$status=GETPOST("search_status", 'alpha')?GETPOST("search_status", 'alpha'):GETPOST("status", 'alpha'); $status=(GETPOST("search_status", 'alpha') != '')?GETPOST("search_status", 'alpha'):GETPOST("status", 'alpha');
$type=GETPOST('search_type', 'alphanohtml')?GETPOST('search_type', 'alphanohtml'):GETPOST('type', 'alphanohtml'); $type=GETPOST('search_type', 'alphanohtml')?GETPOST('search_type', 'alphanohtml'):GETPOST('type', 'alphanohtml');
$optioncss = GETPOST('optioncss', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha');
$year=GETPOST("year", 'int'); $year=GETPOST("year", 'int');
@ -526,6 +526,7 @@ if ($resql)
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
$caction=new CActionComm($db); $caction=new CActionComm($db);
$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1); $arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1);
$contactListCache = array();
while ($i < min($num, $limit)) while ($i < min($num, $limit))
{ {
@ -645,7 +646,34 @@ if ($resql)
// Contact // Contact
if (! empty($arrayfields['a.fk_contact']['checked'])) { if (! empty($arrayfields['a.fk_contact']['checked'])) {
print '<td>'; print '<td>';
if ($obj->fk_contact > 0)
$actionstatic->fetchResources();
if(!empty($actionstatic->socpeopleassigned))
{
$contactList = array();
foreach ($actionstatic->socpeopleassigned as $socpeopleId => $socpeopleassigned)
{
if(!isset($contactListCache[$socpeopleassigned['id']]))
{
// if no cache found we fetch it
$contact = new Contact($db);
if($contact->fetch($socpeopleassigned['id'])>0)
{
$contactListCache[$socpeopleassigned['id']] = $contact->getNomUrl(1, '', 28);
$contactList[] = $contact->getNomUrl(1, '', 28);
}
}
else{
// use cache
$contactList[] = $contactListCache[$socpeopleassigned['id']];
}
}
if(!empty($contactList)){
print implode(', ', $contactList);
}
}
elseif ($obj->fk_contact > 0) //keep for retrocompatibility with faraway event
{ {
$contactstatic->id=$obj->fk_contact; $contactstatic->id=$obj->fk_contact;
$contactstatic->email=$obj->email; $contactstatic->email=$obj->email;

View File

@ -694,7 +694,7 @@ if ($object->id > 0)
if ($num > 0) if ($num > 0)
{ {
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder centpercent lastrecordtable">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastPropals", ($num<=$MAXLIST?"":$MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->id.'">'.$langs->trans("AllPropals").' <span class="badge">'.$num.'</span></a></td>'; print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastPropals", ($num<=$MAXLIST?"":$MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->id.'">'.$langs->trans("AllPropals").' <span class="badge">'.$num.'</span></a></td>';
@ -779,7 +779,7 @@ if ($object->id > 0)
$db->free($resql2); $db->free($resql2);
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder centpercent lastrecordtable">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastCustomerOrders", ($num<=$MAXLIST?"":$MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></a></td>'; print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastCustomerOrders", ($num<=$MAXLIST?"":$MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></a></td>';
@ -855,7 +855,7 @@ if ($object->id > 0)
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
if ($num > 0) { if ($num > 0) {
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder centpercent lastrecordtable">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastSendings", ($num<=$MAXLIST?"":$MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/expedition/list.php?socid='.$object->id.'">'.$langs->trans("AllSendings").' <span class="badge">'.$num.'</span></a></td>'; print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastSendings", ($num<=$MAXLIST?"":$MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/expedition/list.php?socid='.$object->id.'">'.$langs->trans("AllSendings").' <span class="badge">'.$num.'</span></a></td>';
@ -919,7 +919,7 @@ if ($object->id > 0)
if ($num >0) if ($num >0)
{ {
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder centpercent lastrecordtable">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="6"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts", ($num<=$MAXLIST?"":$MAXLIST)).'</td>'; print '<td colspan="6"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts", ($num<=$MAXLIST?"":$MAXLIST)).'</td>';
@ -989,7 +989,7 @@ if ($object->id > 0)
if ($num > 0) if ($num > 0)
{ {
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder centpercent lastrecordtable">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastInterventions", ($num<=$MAXLIST?"":$MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fichinter/list.php?socid='.$object->id.'">'.$langs->trans("AllInterventions").' <span class="badge">'.$num.'</span></td>'; print '<td colspan="3"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastInterventions", ($num<=$MAXLIST?"":$MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fichinter/list.php?socid='.$object->id.'">'.$langs->trans("AllInterventions").' <span class="badge">'.$num.'</span></td>';
@ -1062,7 +1062,7 @@ if ($object->id > 0)
if ($num > 0) if ($num > 0)
{ {
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder centpercent lastrecordtable">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LatestCustomerTemplateInvoices", ($num<=$MAXLIST?"":$MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'">'.$langs->trans("AllCustomerTemplateInvoices").' <span class="badge">'.$num.'</span></a></td>'; print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LatestCustomerTemplateInvoices", ($num<=$MAXLIST?"":$MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'">'.$langs->trans("AllCustomerTemplateInvoices").' <span class="badge">'.$num.'</span></a></td>';
@ -1167,7 +1167,7 @@ if ($object->id > 0)
if ($num > 0) if ($num > 0)
{ {
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder centpercent lastrecordtable">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="5"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastCustomersBills", ($num<=$MAXLIST?"":$MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'">'.$langs->trans("AllBills").' <span class="badge">'.$num.'</span></a></td>'; print '<td colspan="5"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastCustomersBills", ($num<=$MAXLIST?"":$MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'">'.$langs->trans("AllBills").' <span class="badge">'.$num.'</span></a></td>';

View File

@ -1330,9 +1330,9 @@ class Propal extends CommonObject
// Hook of thirdparty module // Hook of thirdparty module
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array('objFrom'=>$this,'clonedObj'=>$clonedObj); $parameters=array('objFrom'=>$this,'clonedObj'=>$object);
$action=''; $action='';
$reshook=$hookmanager->executeHooks('createFrom', $parameters, $clonedObj, $action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) $error++; if ($reshook < 0) $error++;
} }
} }

View File

@ -43,7 +43,7 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
// Load translation files required by the page // Load translation files required by the page
$langs->load("propal"); $langs->load("propal");
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc'); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
$total=0; $ilink=0; $total=0; $ilink=0;
foreach($linkedObjectBlock as $key => $objectlink) foreach($linkedObjectBlock as $key => $objectlink)

View File

@ -1522,11 +1522,11 @@ if ($action == 'create' && $user->rights->commande->creer)
if ($element == 'order' || $element == 'commande') { if ($element == 'order' || $element == 'commande') {
$element = $subelement = 'commande'; $element = $subelement = 'commande';
} }
if ($element == 'propal') { elseif ($element == 'propal') {
$element = 'comm/propal'; $element = 'comm/propal';
$subelement = 'propal'; $subelement = 'propal';
} }
if ($element == 'contract') { elseif ($element == 'contract') {
$element = $subelement = 'contrat'; $element = $subelement = 'contrat';
} }
@ -2119,7 +2119,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '<div class="fichehalfleft">'; print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">'; print '<table class="border tableforfield centpercent">';
if ($soc->outstanding_limit) if ($soc->outstanding_limit)
{ {
@ -2457,7 +2457,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '</div>'; print '</div>';
print '</div>'; print '</div>';
print '</div>'; print '</div>'; // Close fichecenter
print '<div class="clearboth"></div><br>'; print '<div class="clearboth"></div><br>';

View File

@ -39,7 +39,7 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
// Load translation files required by the page // Load translation files required by the page
$langs->load("orders"); $langs->load("orders");
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc'); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
$total=0; $ilink=0; $total=0; $ilink=0;
foreach($linkedObjectBlock as $key => $objectlink) foreach($linkedObjectBlock as $key => $objectlink)

View File

@ -26,13 +26,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
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.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$langs->loadLangs(array("accountancy", "bills", "companies", "salaries")); $langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta"));
$date_start =GETPOST('date_start', 'alpha'); $date_start =GETPOST('date_start', 'alpha');
$date_startDay= GETPOST('date_startday', 'int'); $date_startDay= GETPOST('date_startday', 'int');
@ -503,9 +503,9 @@ if (!empty($date_start) && !empty($date_stop))
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td align="right">'.price($totalET).'</td>'; print '<td align="right">'.price(price2num($totalET, 'MT')).'</td>';
print '<td align="right">'.price($totalIT).'</td>'; print '<td align="right">'.price(price2num($totalIT, 'MT')).'</td>';
print '<td align="right">'.price($totalVAT).'</td>'; print '<td align="right">'.price(price2num($totalVAT, 'MT')).'</td>';
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';

View File

@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
@ -1116,7 +1116,7 @@ if ($resql)
if (! empty($arrayfields['b.rowid']['checked'])) if (! empty($arrayfields['b.rowid']['checked']))
{ {
print '<td class="nowrap left">'; print '<td class="nowrap left">';
print "<a href=\"ligne.php?rowid=".$objp->rowid.'&save_lastsearch_values=1">'.img_object($langs->trans("ShowPayment").': '.$objp->rowid, 'account', 'class="classfortooltip"').' '.$objp->rowid."</a> &nbsp; "; print "<a href=\"line.php?rowid=".$objp->rowid.'&save_lastsearch_values=1">'.img_object($langs->trans("ShowPayment").': '.$objp->rowid, 'account', 'class="classfortooltip"').' '.$objp->rowid."</a> &nbsp; ";
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
@ -1126,7 +1126,7 @@ if ($resql)
{ {
print "<td>"; print "<td>";
//print "<a href=\"ligne.php?rowid=".$objp->rowid."&amp;account=".$objp->fk_account."\">"; //print "<a href=\"line.php?rowid=".$objp->rowid."&amp;account=".$objp->fk_account."\">";
$reg=array(); $reg=array();
preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthee on tente recherche de traduction preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthee on tente recherche de traduction
if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]); if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]);
@ -1459,7 +1459,7 @@ if ($resql)
// Transaction reconciliated or edit link // Transaction reconciliated or edit link
if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
{ {
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?save_lastsearch_values=1&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">'; print '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?save_lastsearch_values=1&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print img_edit(); print img_edit();
print '</a>'; print '</a>';
} }
@ -1467,13 +1467,13 @@ if ($resql)
{ {
if ($user->rights->banque->modifier || $user->rights->banque->consolidate) if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{ {
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?save_lastsearch_values=1&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">'; print '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?save_lastsearch_values=1&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print img_edit(); print img_edit();
print '</a>'; print '</a>';
} }
else else
{ {
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?save_lastsearch_values=1&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">'; print '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?save_lastsearch_values=1&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print img_view(); print img_view();
print '</a>'; print '</a>';
} }

View File

@ -2277,7 +2277,7 @@ class AccountLine extends CommonObject
$result=''; $result='';
$label=$langs->trans("ShowTransaction").': '.$this->rowid; $label=$langs->trans("ShowTransaction").': '.$this->rowid;
$linkstart = '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$this->rowid.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $linkstart = '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$this->rowid.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>'; $linkend='</a>';
$result .= $linkstart; $result .= $linkstart;

View File

@ -45,7 +45,7 @@ $object->info($id);
$h=0; $h=0;
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$id; $head[$h][0] = DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Card");
$h++; $h++;

View File

@ -24,7 +24,7 @@
*/ */
/** /**
* \file htdocs/compta/bank/ligne.php * \file htdocs/compta/bank/line.php
* \ingroup bank * \ingroup bank
* \brief Page to edit a bank transaction record * \brief Page to edit a bank transaction record
*/ */
@ -223,7 +223,7 @@ if ($user->rights->banque->consolidate && ($action == 'num_releve' || $action ==
else $sql.=", rappro = ".$rappro; else $sql.=", rappro = ".$rappro;
$sql.= " WHERE rowid = ".$rowid; $sql.= " WHERE rowid = ".$rowid;
dol_syslog("ligne.php", LOG_DEBUG); dol_syslog("line.php", LOG_DEBUG);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
@ -256,7 +256,7 @@ foreach ($cats as $cat) {
$tabs = array( $tabs = array(
array( array(
DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$rowid, DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$rowid,
$langs->trans('Card') $langs->trans('Card')
), ),
array( array(
@ -416,7 +416,7 @@ if ($result)
print '</a>'; print '</a>';
} }
elseif ($links[$key]['type']=='banktransfert') { elseif ($links[$key]['type']=='banktransfert') {
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$links[$key]['url_id'].'">'; print '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowTransaction'), 'payment').' '; print img_object($langs->trans('ShowTransaction'), 'payment').' ';
print $langs->trans("TransactionOnTheOtherAccount"); print $langs->trans("TransactionOnTheOtherAccount");
print '</a>'; print '</a>';

View File

@ -616,7 +616,7 @@ else
print '<td class="nowrap">'.$type_label.' '.($objp->num_chq?$objp->num_chq:'').$link.'</td>'; print '<td class="nowrap">'.$type_label.' '.($objp->num_chq?$objp->num_chq:'').$link.'</td>';
// Description // Description
print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$object->id.'">'; print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$objp->rowid.'&amp;account='.$object->id.'">';
$reg=array(); $reg=array();
preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthese on tente recherche de traduction preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthese on tente recherche de traduction
if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]); if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]);
@ -662,7 +662,7 @@ else
} }
elseif ($links[$key]['type']=='payment_salary') elseif ($links[$key]['type']=='payment_salary')
{ {
print '<a href="'.DOL_URL_ROOT.'/compta/salaries/card.php?id='.$links[$key]['url_id'].'">'; print '<a href="'.DOL_URL_ROOT.'/salaries/card.php?id='.$links[$key]['url_id'].'">';
print ' '.img_object($langs->trans('ShowPayment'), 'payment').' '; print ' '.img_object($langs->trans('ShowPayment'), 'payment').' ';
print $langs->trans("Payment"); print $langs->trans("Payment");
print '</a>'; print '</a>';
@ -778,7 +778,7 @@ else
if ($user->rights->banque->modifier || $user->rights->banque->consolidate) if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{ {
print '<td class="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?account='.$object->id.'&num='.$numref).'">'; print '<td class="center"><a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$objp->rowid.'&account='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?account='.$object->id.'&num='.$numref).'">';
print img_edit(); print img_edit();
print "</a></td>"; print "</a></td>";
} }

View File

@ -120,9 +120,9 @@ if ($action == 'add')
if (! $error) $bank_line_id_to = $accountto->addline($dateo, $typeto, $label, price2num($amountto), '', '', $user); if (! $error) $bank_line_id_to = $accountto->addline($dateo, $typeto, $label, price2num($amountto), '', '', $user);
if (! ($bank_line_id_to > 0)) $error++; if (! ($bank_line_id_to > 0)) $error++;
if (! $error) $result=$accountfrom->add_url_line($bank_line_id_from, $bank_line_id_to, DOL_URL_ROOT.'/compta/bank/ligne.php?rowid=', '(banktransfert)', 'banktransfert'); if (! $error) $result=$accountfrom->add_url_line($bank_line_id_from, $bank_line_id_to, DOL_URL_ROOT.'/compta/bank/line.php?rowid=', '(banktransfert)', 'banktransfert');
if (! ($result > 0)) $error++; if (! ($result > 0)) $error++;
if (! $error) $result=$accountto->add_url_line($bank_line_id_to, $bank_line_id_from, DOL_URL_ROOT.'/compta/bank/ligne.php?rowid=', '(banktransfert)', 'banktransfert'); if (! $error) $result=$accountto->add_url_line($bank_line_id_to, $bank_line_id_from, DOL_URL_ROOT.'/compta/bank/line.php?rowid=', '(banktransfert)', 'banktransfert');
if (! ($result > 0)) $error++; if (! ($result > 0)) $error++;
if (! $error) if (! $error)

View File

@ -31,7 +31,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';

View File

@ -2773,7 +2773,7 @@ if ($action == 'create')
$note_public = $invoice_predefined->note_public; $note_public = $invoice_predefined->note_public;
$note_private = $invoice_predefined->note_private; $note_private = $invoice_predefined->note_private;
$sql = 'SELECT r.rowid, r.titre, r.total_ttc'; $sql = 'SELECT r.rowid, r.titre as title, r.total_ttc';
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as r'; $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as r';
$sql .= ' WHERE r.fk_soc = ' . $invoice_predefined->socid; $sql .= ' WHERE r.fk_soc = ' . $invoice_predefined->socid;
@ -2797,7 +2797,7 @@ if ($action == 'create')
print ' selected'; print ' selected';
$exampletemplateinvoice->fetch(GETPOST('fac_rec')); $exampletemplateinvoice->fetch(GETPOST('fac_rec'));
} }
print '>' . $objp->titre . ' (' . price($objp->total_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; print '>' . $objp->title . ' (' . price($objp->total_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
$i ++; $i ++;
} }
print '</select>'; print '</select>';

View File

@ -123,7 +123,8 @@ class FactureRec extends CommonInvoice
$now=dol_now(); $now=dol_now();
// Clean parameters // Clean parameters
$this->titre=trim($this->titre); $this->titre=trim($this->titre); // deprecated
$this->title=trim($this->title);
$this->usenewprice=empty($this->usenewprice)?0:$this->usenewprice; $this->usenewprice=empty($this->usenewprice)?0:$this->usenewprice;
if (empty($this->suspended)) $this->suspended=0; if (empty($this->suspended)) $this->suspended=0;
@ -180,7 +181,7 @@ class FactureRec extends CommonInvoice
$sql.= ", multicurrency_tx"; $sql.= ", multicurrency_tx";
$sql.= ", suspended"; $sql.= ", suspended";
$sql.= ") VALUES ("; $sql.= ") VALUES (";
$sql.= "'".$this->db->escape($this->titre)."'"; $sql.= "'".$this->db->escape($this->titre ? $this->titre : $this->title)."'";
$sql.= ", ".$facsrc->socid; $sql.= ", ".$facsrc->socid;
$sql.= ", ".$conf->entity; $sql.= ", ".$conf->entity;
$sql.= ", '".$this->db->idate($now)."'"; $sql.= ", '".$this->db->idate($now)."'";
@ -376,7 +377,7 @@ class FactureRec extends CommonInvoice
*/ */
public function fetch($rowid, $ref = '', $ref_ext = '', $ref_int = '') public function fetch($rowid, $ref = '', $ref_ext = '', $ref_int = '')
{ {
$sql = 'SELECT f.rowid, f.entity, f.titre, f.suspended, f.fk_soc, f.amount, f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc'; $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc, f.amount, f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc';
$sql.= ', f.remise_percent, f.remise_absolue, f.remise'; $sql.= ', f.remise_percent, f.remise_absolue, f.remise';
$sql.= ', f.date_lim_reglement as dlr'; $sql.= ', f.date_lim_reglement as dlr';
$sql.= ', f.note_private, f.note_public, f.fk_user_author'; $sql.= ', f.note_private, f.note_public, f.fk_user_author';
@ -410,8 +411,9 @@ class FactureRec extends CommonInvoice
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->entity = $obj->entity; $this->entity = $obj->entity;
$this->titre = $obj->titre; $this->titre = $obj->title; // deprecated
$this->ref = $obj->titre; $this->title = $obj->title;
$this->ref = $obj->title;
$this->ref_client = $obj->ref_client; $this->ref_client = $obj->ref_client;
$this->suspended = $obj->suspended; $this->suspended = $obj->suspended;
$this->type = $obj->type; $this->type = $obj->type;

View File

@ -187,7 +187,8 @@ if (empty($reshook))
if (! $error) if (! $error)
{ {
$object->titre = GETPOST('titre', 'alpha'); $object->titre = GETPOST('titre', 'alpha'); // deprecated
$object->title = GETPOST('titre', 'alpha');
$object->note_private = GETPOST('note_private', 'none'); $object->note_private = GETPOST('note_private', 'none');
$object->note_public = GETPOST('note_public', 'none'); $object->note_public = GETPOST('note_public', 'none');
$object->modelpdf = GETPOST('modelpdf', 'alpha'); $object->modelpdf = GETPOST('modelpdf', 'alpha');
@ -295,8 +296,9 @@ if (empty($reshook))
$result=$object->setValueFrom('titre', GETPOST('ref', 'alpha'), '', null, 'text', '', $user, 'BILLREC_MODIFY'); $result=$object->setValueFrom('titre', GETPOST('ref', 'alpha'), '', null, 'text', '', $user, 'BILLREC_MODIFY');
if ($result > 0) if ($result > 0)
{ {
$object->titre = GETPOST('ref', 'alpha'); $object->titre = GETPOST('ref', 'alpha'); // deprecated
$object->ref = $object->titre; $object->title = GETPOST('ref', 'alpha');
$object->ref = $object->title;
} }
else dol_print_error($db, $object->error, $object->errors); else dol_print_error($db, $object->error, $object->errors);
} }
@ -774,7 +776,7 @@ if (empty($reshook))
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
$objectline = new FactureLigneRec($db); $objectline = new FactureLigneRec($db);
if ($objectline->fetch(GETPOST('lineid'))) if ($objectline->fetch(GETPOST('lineid', 'int')))
{ {
$objectline->array_options=$array_options; $objectline->array_options=$array_options;
$result=$objectline->insertExtraFields(); $result=$objectline->insertExtraFields();
@ -784,6 +786,8 @@ if (empty($reshook))
} }
} }
$position = ($objectline->rang >= 0 ? $objectline->rang : 0);
// Unset extrafield // Unset extrafield
if (is_array($extralabelsline)) if (is_array($extralabelsline))
{ {
@ -795,8 +799,8 @@ if (empty($reshook))
} }
// Define special_code for special lines // Define special_code for special lines
$special_code=GETPOST('special_code'); $special_code=GETPOST('special_code', 'int');
if (! GETPOST('qty')) $special_code=3; if (! GETPOST('qty', 'alpha')) $special_code=3;
/*$line = new FactureLigne($db); /*$line = new FactureLigne($db);
$line->fetch(GETPOST('lineid')); $line->fetch(GETPOST('lineid'));
@ -832,11 +836,11 @@ if (empty($reshook))
$error ++; $error ++;
} }
} else { } else {
$type = GETPOST('type'); $type = GETPOST('type', 'int');
$label = (GETPOST('product_label') ? GETPOST('product_label') : ''); $label = (GETPOST('product_label') ? GETPOST('product_label') : '');
// Check parameters // Check parameters
if (GETPOST('type') < 0) { if (GETPOST('type', 'int') < 0) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
$error ++; $error ++;
} }
@ -868,7 +872,7 @@ if (empty($reshook))
0, 0,
0, 0,
$type, $type,
0, $position,
$special_code, $special_code,
$label, $label,
GETPOST('units'), GETPOST('units'),
@ -1423,8 +1427,8 @@ else
include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php'; include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php';
$list = array(); $list = array();
$models = ModelePDFFactures::liste_modeles($db); $models = ModelePDFFactures::liste_modeles($db);
foreach ($models as $model) { foreach ($models as $k => $model) {
$list[] = $model . ':' . $model; $list[] = str_replace(':', '|', $k) . ':' . $model;
} }
$select = 'select;'.implode(',', $list); $select = 'select;'.implode(',', $list);
print $form->editfieldval($langs->trans("Model"), 'modelpdf', $object->modelpdf, $object, $user->rights->facture->creer, $select); print $form->editfieldval($langs->trans("Model"), 'modelpdf', $object->modelpdf, $object, $user->rights->facture->creer, $select);

View File

@ -213,7 +213,7 @@ $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['
/* /*
* List mode * List mode
*/ */
$sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, f.total, f.tva as total_vat, f.total_ttc, f.frequency, f.unit_frequency,"; $sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre as title, f.total, f.tva as total_vat, f.total_ttc, f.frequency, f.unit_frequency,";
$sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,"; $sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,";
$sql.= " f.datec, f.tms,"; $sql.= " f.datec, f.tms,";
$sql.= " f.fk_cond_reglement, f.fk_mode_reglement"; $sql.= " f.fk_cond_reglement, f.fk_mode_reglement";
@ -514,7 +514,7 @@ if ($resql)
$invoicerectmp->unit_frequency=$objp->unit_frequency; $invoicerectmp->unit_frequency=$objp->unit_frequency;
$invoicerectmp->nb_gen_max=$objp->nb_gen_max; $invoicerectmp->nb_gen_max=$objp->nb_gen_max;
$invoicerectmp->nb_gen_done=$objp->nb_gen_done; $invoicerectmp->nb_gen_done=$objp->nb_gen_done;
$invoicerectmp->ref=$objp->titre; $invoicerectmp->ref=$objp->title;
print '<tr class="oddeven">'; print '<tr class="oddeven">';

View File

@ -62,13 +62,22 @@ if ($id > 0 || ! empty($ref))
} }
} }
$hookmanager->initHooks(array('directdebitcard','globalcard'));
/* /*
* Actions * Actions
*/ */
if ($action == "new") $parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{ {
if ($action == "new")
{
if ($object->id > 0) if ($object->id > 0)
{ {
$db->begin(); $db->begin();
@ -87,10 +96,10 @@ if ($action == "new")
} }
} }
$action=''; $action='';
} }
if ($action == "delete") if ($action == "delete")
{ {
if ($object->id > 0) if ($object->id > 0)
{ {
$result = $object->demande_prelevement_delete($user, GETPOST('did')); $result = $object->demande_prelevement_delete($user, GETPOST('did'));
@ -100,6 +109,7 @@ if ($action == "delete")
exit; exit;
} }
} }
}
} }

View File

@ -38,7 +38,7 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
$langs->load("bills"); $langs->load("bills");
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc'); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
$total=0; $ilink=0; $total=0; $ilink=0;
foreach($linkedObjectBlock as $key => $objectlink) foreach($linkedObjectBlock as $key => $objectlink)

View File

@ -412,8 +412,8 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '<td class="left">'; print '<td class="left">';
print $thirdpartystatic->getNomUrl(1, 'customer', 44); print $thirdpartystatic->getNomUrl(1, 'customer', 44);
print '</td>'; print '</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="nowrap right">'.price($obj->total_ht).'</td>';
print '<td class="right">'.price($obj->total_ttc).'</td>'; print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
print '<td class="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>'; print '<td class="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3, $obj->am).'</td>'; print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3, $obj->am).'</td>';
print '</tr>'; print '</tr>';
@ -512,7 +512,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print $thirdpartystatic->getNomUrl(1, 'supplier', 44); print $thirdpartystatic->getNomUrl(1, 'supplier', 44);
print '</td>'; print '</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
print '<td class="right">'.price($obj->total_ttc).'</td>'; print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
print '<td class="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>'; print '<td class="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3).'</td>'; print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3).'</td>';
print '</tr>'; print '</tr>';
@ -593,7 +593,7 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire)
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$donationstatic->getNomUrl(1).'</td>'; print '<td>'.$donationstatic->getNomUrl(1).'</td>';
print '<td>'.$label.'</td>'; print '<td>'.$label.'</td>';
print '<td class="right">'.price($objp->amount).'</td>'; print '<td class="nowrap right">'.price($objp->amount).'</td>';
print '<td class="right">'.dol_print_date($db->jdate($objp->dm), 'day').'</td>'; print '<td class="right">'.dol_print_date($db->jdate($objp->dm), 'day').'</td>';
print '<td>'.$donationstatic->LibStatut($objp->fk_statut, 3).'</td>'; print '<td>'.$donationstatic->LibStatut($objp->fk_statut, 3).'</td>';
print '</tr>'; print '</tr>';
@ -664,8 +664,8 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$chargestatic->getNomUrl(1).'</td>'; print '<td>'.$chargestatic->getNomUrl(1).'</td>';
print '<td align="center">'.dol_print_date($db->jdate($obj->date_ech), 'day').'</td>'; print '<td align="center">'.dol_print_date($db->jdate($obj->date_ech), 'day').'</td>';
print '<td class="right">'.price($obj->amount).'</td>'; print '<td class="nowrap right">'.price($obj->amount).'</td>';
print '<td class="right">'.price($obj->sumpaid).'</td>'; print '<td class="nowrap right">'.price($obj->sumpaid).'</td>';
print '<td align="center">'.$chargestatic->getLibStatut(3).'</td>'; print '<td align="center">'.$chargestatic->getLibStatut(3).'</td>';
print '</tr>'; print '</tr>';
$tot_ttc+=$obj->amount; $tot_ttc+=$obj->amount;
@ -673,7 +673,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
} }
print '<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans("Total").'</td>'; print '<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans("Total").'</td>';
print '<td class="right">'.price($tot_ttc).'</td>'; print '<td class="nowrap right">'.price($tot_ttc).'</td>';
print '<td class="right"></td>'; print '<td class="right"></td>';
print '<td class="right">&nbsp;</td>'; print '<td class="right">&nbsp;</td>';
print '</tr>'; print '</tr>';
@ -786,8 +786,8 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
print $societestatic->getNomUrl(1, 'customer', 44); print $societestatic->getNomUrl(1, 'customer', 44);
print '</td>'; print '</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
print '<td class="right">'.price($obj->total_ttc).'</td>'; print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
print '<td class="right">'.price($obj->total_ttc-$obj->tot_fttc).'</td>'; print '<td class="nowrap right">'.price($obj->total_ttc-$obj->tot_fttc).'</td>';
print '<td>'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>'; print '<td>'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>';
print '</tr>'; print '</tr>';
$tot_ht += $obj->total_ht; $tot_ht += $obj->total_ht;
@ -799,8 +799,8 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')</font> </td>'; print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')</font> </td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($tot_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($tot_ht).'</td>';
print '<td class="right">'.price($tot_ttc).'</td>'; print '<td class="nowrap right">'.price($tot_ttc).'</td>';
print '<td class="right">'.price($tot_tobill).'</td>'; print '<td class="nowrap right">'.price($tot_tobill).'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
print '</table></div><br>'; print '</table></div><br>';
@ -911,8 +911,8 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '</td>'; print '</td>';
print '<td class="right">'.dol_print_date($db->jdate($obj->datelimite), 'day').'</td>'; print '<td class="right">'.dol_print_date($db->jdate($obj->datelimite), 'day').'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
print '<td class="right">'.price($obj->total_ttc).'</td>'; print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
print '<td class="right">'.price($obj->am).'</td>'; print '<td class="nowrap right">'.price($obj->am).'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3, $obj->am).'</td>'; print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3, $obj->am).'</td>';
print '</tr>'; print '</tr>';
@ -926,8 +926,8 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')</font> </td>'; print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')</font> </td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($total).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($total).'</td>';
print '<td class="right">'.price($total_ttc).'</td>'; print '<td class="nowrap right">'.price($total_ttc).'</td>';
print '<td class="right">'.price($totalam).'</td>'; print '<td class="nowrap right">'.price($totalam).'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
} }
@ -1023,8 +1023,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>'; print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>';
print '<td class="right">'.dol_print_date($db->jdate($obj->date_lim_reglement), 'day').'</td>'; print '<td class="right">'.dol_print_date($db->jdate($obj->date_lim_reglement), 'day').'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
print '<td class="right">'.price($obj->total_ttc).'</td>'; print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
print '<td class="right">'.price($obj->am).'</td>'; print '<td class="nowrap right">'.price($obj->am).'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3).'</td>'; print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3).'</td>';
print '</tr>'; print '</tr>';
$total += $obj->total_ht; $total += $obj->total_ht;
@ -1036,8 +1036,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')</font> </td>'; print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')</font> </td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($total).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($total).'</td>';
print '<td class="right">'.price($total_ttc).'</td>'; print '<td class="nowrap right">'.price($total_ttc).'</td>';
print '<td class="right">'.price($totalam).'</td>'; print '<td class="nowrap right">'.price($totalam).'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
} }

View File

@ -87,7 +87,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
$date_start=dol_get_first_day($pastmonthyear, $pastmonth, false); $date_end=dol_get_last_day($pastmonthyear, $pastmonth, false); $date_start=dol_get_first_day($pastmonthyear, $pastmonth, false); $date_end=dol_get_last_day($pastmonthyear, $pastmonth, false);
} }
$nom=$langs->trans("SellsJournal"); $name=$langs->trans("SellsJournal");
$periodlink=''; $periodlink='';
$exportlink=''; $exportlink='';
$builddate=dol_now(); $builddate=dol_now();

View File

@ -63,34 +63,41 @@ $object = new BonPrelevement($db, "");
// Load object // Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
$hookmanager->initHooks(array('directdebitprevcard','globalcard'));
/* /*
* Actions * Actions
*/ */
if ( $action == 'confirm_delete' ) $parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{ {
if ( $action == 'confirm_delete' )
{
$res=$object->delete($user); $res=$object->delete($user);
if ($res > 0) if ($res > 0)
{ {
header("Location: index.php"); header("Location: index.php");
exit; exit;
} }
} }
// Seems to no be used and replaced with $action == 'infocredit // Seems to no be used and replaced with $action == 'infocredit'
if ( $action == 'confirm_credite' && GETPOST('confirm', 'alpha') == 'yes') if ( $action == 'confirm_credite' && GETPOST('confirm', 'alpha') == 'yes')
{ {
$res=$object->set_credite(); $res=$object->set_credite();
if ($res >= 0) if ($res >= 0)
{ {
header("Location: card.php?id=".$id); header("Location: card.php?id=".$id);
exit; exit;
} }
} }
if ($action == 'infotrans' && $user->rights->prelevement->bons->send) if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); $dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
@ -121,11 +128,11 @@ if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
header("Location: card.php?id=".$id."&error=$error"); header("Location: card.php?id=".$id."&error=$error");
exit; exit;
} }
} }
// Set direct debit order to credited, create payment and close invoices // Set direct debit order to credited, create payment and close invoices
if ($action == 'infocredit' && $user->rights->prelevement->bons->credit) if ($action == 'infocredit' && $user->rights->prelevement->bons->credit)
{ {
$dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); $dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
$error = $object->set_infocredit($user, $dt); $error = $object->set_infocredit($user, $dt);
@ -135,6 +142,7 @@ if ($action == 'infocredit' && $user->rights->prelevement->bons->credit)
header("Location: card.php?id=".$id."&error=$error"); header("Location: card.php?id=".$id."&error=$error");
exit; exit;
} }
}
} }
@ -362,7 +370,7 @@ if ($id > 0 || $ref)
print "<td>"; print "<td>";
print $ligne->LibStatut($obj->statut, 2); print $ligne->LibStatut($obj->statut, 2);
print "&nbsp;"; print "&nbsp;";
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">'; print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'">';
print sprintf("%06s", $obj->rowid); print sprintf("%06s", $obj->rowid);
print '</a></td>'; print '</a></td>';

View File

@ -1136,29 +1136,53 @@ class BonPrelevement extends CommonObject
* Get object and lines from database * Get object and lines from database
* *
* @param User $user Object user that delete * @param User $user Object user that delete
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
public function delete($user = null) public function delete($user = null, $notrigger = 0)
{ {
$this->db->begin(); $this->db->begin();
$error = 0;
$resql1 = $resql2 = $resql3 = $resql4 = 0;
if (! $notrigger)
{
// Call trigger
$result=$this->call_trigger('BON_PRELEVEMENT_DELETE', $user);
if ($result < 0) $error++;
// End call triggers
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_facture WHERE fk_prelevement_lignes IN (SELECT rowid FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".$this->id.")"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_facture WHERE fk_prelevement_lignes IN (SELECT rowid FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".$this->id.")";
$resql1=$this->db->query($sql); $resql1=$this->db->query($sql);
if (! $resql1) dol_print_error($this->db); if (! $resql1) dol_print_error($this->db);
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".$this->id; $sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".$this->id;
$resql2=$this->db->query($sql); $resql2=$this->db->query($sql);
if (! $resql2) dol_print_error($this->db); if (! $resql2) dol_print_error($this->db);
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_bons WHERE rowid = ".$this->id; $sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_bons WHERE rowid = ".$this->id;
$resql3=$this->db->query($sql); $resql3=$this->db->query($sql);
if (! $resql3) dol_print_error($this->db); if (! $resql3) dol_print_error($this->db);
}
if (! $error)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_facture_demande SET fk_prelevement_bons = NULL, traite = 0 WHERE fk_prelevement_bons = ".$this->id; $sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_facture_demande SET fk_prelevement_bons = NULL, traite = 0 WHERE fk_prelevement_bons = ".$this->id;
$resql4=$this->db->query($sql); $resql4=$this->db->query($sql);
if (! $resql4) dol_print_error($this->db); if (! $resql4) dol_print_error($this->db);
}
if ($resql1 && $resql2 && $resql3) if ($resql1 && $resql2 && $resql3 && $resql4 && ! $error)
{ {
$this->db->commit(); $this->db->commit();
return 1; return 1;
@ -1393,7 +1417,7 @@ class BonPrelevement extends CommonObject
$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,"; $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,";
$sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; $sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
$sql.= " f.ref as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum"; $sql.= " f.ref as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum";
$sql.= " FROM"; $sql.= " FROM";
$sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; $sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
$sql.= " ".MAIN_DB_PREFIX."facture as f,"; $sql.= " ".MAIN_DB_PREFIX."facture as f,";
@ -1419,7 +1443,7 @@ class BonPrelevement extends CommonObject
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum); $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum, $obj->rum);
$this->total = $this->total + $obj->somme; $this->total = $this->total + $obj->somme;
$i++; $i++;
} }
@ -1630,9 +1654,10 @@ class BonPrelevement extends CommonObject
* @param string $row_bic rib.bic AS bic, * @param string $row_bic rib.bic AS bic,
* @param string $row_datec rib.datec, * @param string $row_datec rib.datec,
* @param string $row_drum rib.rowid used to generate rum * @param string $row_drum rib.rowid used to generate rum
* @param string $row_rum rib.rum Rum defined on company bank account
* @return string Return string with SEPA part DrctDbtTxInf * @return string Return string with SEPA part DrctDbtTxInf
*/ */
public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum) public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum, $row_rum)
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@ -1644,7 +1669,7 @@ class BonPrelevement extends CommonObject
// Define value for RUM // Define value for RUM
// Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId) // Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId)
$Rum = $this->buildRumNumber($row_code_client, $row_datec, $row_drum); $Rum = empty($row_rum) ? $this->buildRumNumber($row_code_client, $row_datec, $row_drum) : $row_rum;
// Define date of RUM signature // Define date of RUM signature
$DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d'); $DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d');

View File

@ -52,20 +52,29 @@ $page = GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page; $offset = $limit * $page;
$hookmanager->initHooks(array('directdebitcreatecard','globalcard'));
/* /*
* Actions * Actions
*/ */
// Change customer bank information to withdraw $parameters = array('mode' => $mode, 'format' => $format, 'limit' => $limit, 'page' => $page, 'offset' => $offset);
if ($action == 'modify') $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{ {
// Change customer bank information to withdraw
if ($action == 'modify')
{
for ($i = 1 ; $i < 9 ; $i++) for ($i = 1 ; $i < 9 ; $i++)
{ {
dolibarr_set_const($db, GETPOST("nom$i"), GETPOST("value$i"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, GETPOST("nom$i"), GETPOST("value$i"), 'chaine', 0, '', $conf->entity);
} }
} }
if ($action == 'create') if ($action == 'create')
{ {
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty // $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty
$bprev = new BonPrelevement($db); $bprev = new BonPrelevement($db);
$executiondate = dol_mktime(0, 0, 0, GETPOST('remonth'), (GETPOST('reday')+$conf->global->PRELEVEMENT_ADDDAYS), GETPOST('reyear')); $executiondate = dol_mktime(0, 0, 0, GETPOST('remonth'), (GETPOST('reday')+$conf->global->PRELEVEMENT_ADDDAYS), GETPOST('reyear'));
@ -89,6 +98,7 @@ if ($action == 'create')
{ {
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null); setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
} }
}
} }

View File

@ -203,7 +203,7 @@ if ($resql)
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">'; print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'">';
print img_picto('', 'statut'.$obj->statut).' '; print img_picto('', 'statut'.$obj->statut).' ';
print substr('000000'.$obj->rowid, -6); print substr('000000'.$obj->rowid, -6);
print '</a></td>'; print '</a></td>';

View File

@ -20,7 +20,7 @@
*/ */
/** /**
* \file htdocs/compta/prelevement/ligne.php * \file htdocs/compta/prelevement/line.php
* \ingroup prelevement * \ingroup prelevement
* \brief card of withdraw line * \brief card of withdraw line
*/ */
@ -86,7 +86,7 @@ if ($action == 'confirm_rejet')
$rej->create($user, $id, GETPOST('motif', 'alpha'), $daterej, $lipre->bon_rowid, GETPOST('facturer', 'int')); $rej->create($user, $id, GETPOST('motif', 'alpha'), $daterej, $lipre->bon_rowid, GETPOST('facturer', 'int'));
header("Location: ligne.php?id=".$id); header("Location: line.php?id=".$id);
exit; exit;
} }
} }
@ -97,7 +97,7 @@ if ($action == 'confirm_rejet')
} }
else else
{ {
header("Location: ligne.php?id=".$id); header("Location: line.php?id=".$id);
exit; exit;
} }
} }
@ -112,7 +112,7 @@ $invoicestatic=new Facture($db);
llxHeader('', $langs->trans("StandingOrder")); llxHeader('', $langs->trans("StandingOrder"));
$h = 0; $h = 0;
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$id; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Card");
$hselected = $h; $hselected = $h;
$h++; $h++;
@ -179,7 +179,7 @@ if ($id)
$rej = new RejetPrelevement($db, $user); $rej = new RejetPrelevement($db, $user);
print '<form name="confirm_rejet" method="post" action="ligne.php?id='.$id.'">'; print '<form name="confirm_rejet" method="post" action="line.php?id='.$id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="confirm_rejet">'; print '<input type="hidden" name="action" value="confirm_rejet">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -231,7 +231,7 @@ if ($id)
{ {
if ($user->rights->prelevement->bons->credit) if ($user->rights->prelevement->bons->credit)
{ {
print "<a class=\"butAction\" href=\"ligne.php?action=rejet&amp;id=$lipre->id\">".$langs->trans("StandingOrderReject")."</a>"; print "<a class=\"butAction\" href=\"line.php?action=rejet&amp;id=$lipre->id\">".$langs->trans("StandingOrderReject")."</a>";
} }
else else
{ {

View File

@ -172,7 +172,7 @@ if ($result)
print $ligne->LibStatut($obj->statut_ligne, 2); print $ligne->LibStatut($obj->statut_ligne, 2);
print "&nbsp;"; print "&nbsp;";
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid_ligne.'">'; print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.'">';
print substr('000000'.$obj->rowid_ligne, -6); print substr('000000'.$obj->rowid_ligne, -6);
print '</a></td>'; print '</a></td>';

View File

@ -100,7 +100,7 @@ if ($result)
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $ligne->LibStatut($obj->statut, 2).'&nbsp;'; print $ligne->LibStatut($obj->statut, 2).'&nbsp;';
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">'; print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'">';
print substr('000000'.$obj->rowid, -6)."</a></td>"; print substr('000000'.$obj->rowid, -6)."</a></td>";

View File

@ -773,7 +773,7 @@ else
print '<tr class="oddeven"><td>&nbsp;</td>'; print '<tr class="oddeven"><td>&nbsp;</td>';
print "<td>".$langs->trans("Salary")." <a href=\"".DOL_URL_ROOT."/compta/salaries/list.php?filtre=s.fk_user=".$obj->fk_user."\">".$obj->firstname." ".$obj->lastname."</a></td>\n"; print "<td>".$langs->trans("Salary")." <a href=\"".DOL_URL_ROOT."/salaries/list.php?filtre=s.fk_user=".$obj->fk_user."\">".$obj->firstname." ".$obj->lastname."</a></td>\n";
if ($modecompta == 'CREANCES-DETTES') print '<td class="right">'.price(-$obj->amount).'</td>'; if ($modecompta == 'CREANCES-DETTES') print '<td class="right">'.price(-$obj->amount).'</td>';
print '<td class="right">'.price(-$obj->amount).'</td>'; print '<td class="right">'.price(-$obj->amount).'</td>';

View File

@ -655,7 +655,7 @@ if ($id > 0)
else else
{ {
print '<tr class="oddeven"><td class="opacitymedium">'.$langs->trans("None").'</td>'; print '<tr class="oddeven"><td><span class="opacitymedium">'.$langs->trans("None").'</span></td>';
print '<td></td><td></td><td></td><td></td>'; print '<td></td><td></td><td></td><td></td>';
print '</tr>'; print '</tr>';
} }

View File

@ -30,7 +30,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
// Load translation files required by the page // Load translation files required by the page

View File

@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin","accountancy")); $langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin","accountancy"));
$modecompta = GETPOST('modecompta', 'alpha'); $modecompta = (GETPOST('modecompta', 'alpha') ? GETPOST('modecompta', 'alpha') : $conf->global->ACCOUNTING_MODE);
// Date range // Date range
$year=GETPOST("year", 'int'); $year=GETPOST("year", 'int');

View File

@ -5,6 +5,7 @@
* Copyright (C) 2006-2015 Yannick Warnier <ywarnier@beeznest.org> * Copyright (C) 2006-2015 Yannick Warnier <ywarnier@beeznest.org>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Eric Seigne <eric.seigne@cap-rel.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -116,7 +117,8 @@ foreach ($listofparams as $param)
if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param); if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param);
} }
llxHeader('', $langs->trans("VATReport"), '', '', 0, 0, '', '', $morequerystring); $title = $langs->trans("VATReport") . " " . dol_print_date($date_start) . " -> " . dol_print_date($date_end);
llxHeader('', $title, '', '', 0, 0, '', '', $morequerystring);
//print load_fiche_titre($langs->trans("VAT"),""); //print load_fiche_titre($langs->trans("VAT"),"");
@ -184,8 +186,10 @@ if ($mysoc->tva_assuj) {
$vatsup.=' ('.$langs->trans("ToGetBack").')'; $vatsup.=' ('.$langs->trans("ToGetBack").')';
} }
$optioncss = GETPOST('optioncss');
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode); if($optioncss != "print") {
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
}
$vatcust=$langs->trans("VATReceived"); $vatcust=$langs->trans("VATReceived");
$vatsup=$langs->trans("VATPaid"); $vatsup=$langs->trans("VATPaid");

View File

@ -573,7 +573,7 @@ else
// Civility // Civility
print '<tr><td><label for="civility_id">'.$langs->trans("UserTitle").'</label></td><td colspan="3">'; print '<tr><td><label for="civility_id">'.$langs->trans("UserTitle").'</label></td><td colspan="3">';
print $formcompany->select_civility(GETPOST("civility_id", 'alpha')?GETPOST("civility_id", 'alpha'):$object->civility_id); print $formcompany->select_civility(GETPOST("civility", 'alpha')?GETPOST("civility", 'alpha'):$object->civility_code);
print '</td></tr>'; print '</td></tr>';
print '<tr><td><label for="title">'.$langs->trans("PostOrFunction").'</label></td>'; print '<tr><td><label for="title">'.$langs->trans("PostOrFunction").'</label></td>';
@ -872,7 +872,7 @@ else
// Civility // Civility
print '<tr><td><label for="civility_id">'.$langs->trans("UserTitle").'</label></td><td colspan="3">'; print '<tr><td><label for="civility_id">'.$langs->trans("UserTitle").'</label></td><td colspan="3">';
print $formcompany->select_civility(isset($_POST["civility_id"])?GETPOST("civility_id"):$object->civility_id); print $formcompany->select_civility(isset($_POST["civility"])?GETPOST("civility"):$object->civility_code);
print '</td></tr>'; print '</td></tr>';
print '<tr><td><label for="title">'.$langs->trans("PostOrFunction").'</label></td>'; print '<tr><td><label for="title">'.$langs->trans("PostOrFunction").'</label></td>';

View File

@ -499,6 +499,7 @@ class Contact extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
* *
@ -508,7 +509,7 @@ class Contact extends CommonObject
* 2=Return key only (uid=qqq) * 2=Return key only (uid=qqq)
* @return string DN * @return string DN
*/ */
private function _load_ldap_dn($info, $mode = 0) public function _load_ldap_dn($info, $mode = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@ -1218,7 +1219,7 @@ class Contact extends CommonObject
global $langs; global $langs;
$langs->load("dict"); $langs->load("dict");
$code=(! empty($this->civility_id)?$this->civility_id:(! empty($this->civilite_id)?$this->civilite_id:'')); $code=(! empty($this->civility_id)?$this->civility:(! empty($this->civilite)?$this->civilite:''));
if (empty($code)) return ''; if (empty($code)) return '';
return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civility", "code", "label", $code); return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civility", "code", "label", $code);
} }

261
htdocs/contrat/agenda.php Normal file
View File

@ -0,0 +1,261 @@
<?php
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/contrat/agenda.php
* \ingroup contrat
* \brief Page of contract events
*/
require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
// Load translation files required by the page
$langs->loadLangs(array("companies", "contracts"));
if (GETPOST('actioncode', 'array'))
{
$actioncode=GETPOST('actioncode', 'array', 3);
if (! count($actioncode)) $actioncode='0';
}
else
{
$actioncode=GETPOST("actioncode", "alpha", 3)?GETPOST("actioncode", "alpha", 3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
}
$search_agenda_label=GETPOST('search_agenda_label');
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contrat', $id, '');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortfield) $sortfield='a.datep,a.id';
if (! $sortorder) $sortorder='DESC,DESC';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('agendacontract','globalcard'));
/*
* Actions
*/
$parameters=array('id'=>$id);
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
// Cancel
if (GETPOST('cancel', 'alpha') && ! empty($backtopage))
{
header("Location: ".$backtopage);
exit;
}
// Purge search criteria
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
{
$actioncode='';
$search_agenda_label='';
}
}
/*
* View
*/
$form = new Form($db);
$formfile = new FormFile($db);
if (! empty($conf->projet->enabled)) $formproject = new FormProjets($db);
if ($id > 0)
{
// Load object modContract
$module=(! empty($conf->global->CONTRACT_ADDON)?$conf->global->CONTRACT_ADDON:'mod_contract_serpis');
if (substr($module, 0, 13) == 'mod_contract_' && substr($module, -3) == 'php')
{
$module = substr($module, 0, dol_strlen($module)-4);
}
$result=dol_include_once('/core/modules/contract/'.$module.'.php');
if ($result > 0)
{
$modCodeContract = new $module();
}
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$object = new Contrat($db);
$result = $object->fetch($id);
$object->fetch_thirdparty();
$title=$langs->trans("Agenda");
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contractrefonly/', $conf->global->MAIN_HTML_TITLE) && $object->ref) $title=$object->ref." - ".$title;
llxHeader('', $title);
if (! empty($conf->notification->enabled)) $langs->load("mails");
$head = contract_prepare_head($object);
dol_fiche_head($head, 'agenda', $langs->trans("Contract"), -1, 'contract');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$morehtmlref='';
if (! empty($modCodeContract->code_auto)) {
$morehtmlref.=$object->ref;
} else {
$morehtmlref.=$form->editfieldkey("", 'ref', $object->ref, $object, $user->rights->contrat->creer, 'string', '', 0, 3);
$morehtmlref.=$form->editfieldval("", 'ref', $object->ref, $object, $user->rights->contrat->creer, 'string', '', 0, 2);
}
$morehtmlref.='<div class="refidno">';
// Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->contrat->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1, 'getFormatedCustomerRef');
// Ref supplier
$morehtmlref.='<br>';
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->thirdparty->id.'&search_name='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherContracts").'</a>)';
// Project
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->contrat->creer)
{
if ($action != 'classify')
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}
$morehtmlref.='</div>';
dol_banner_tab($object, 'id', $linkback, 1, 'ref', 'none', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
$object->info($id);
dol_print_object_info($object, 1);
print '</div>';
dol_fiche_end();
// Actions buttons
/*$objthirdparty=$object;
$objcon=new stdClass();
$out='';
$permok=$user->rights->agenda->myactions->create;
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
{
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($objthirdparty) == 'Societe') $out.='&amp;socid='.$objthirdparty->id;
$out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1';
//$out.=$langs->trans("AddAnAction").' ';
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
//$out.="</a>";
}*/
//print '<div class="tabsAction">';
//print '</div>';
$newcardbutton='';
if (! empty($conf->agenda->enabled))
{
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
{
$newcardbutton.= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
}
}
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
{
print '<br>';
$param='&id='.$id;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
print load_fiche_titre($langs->trans("ActionsOnContract"), $newcardbutton, '');
//print_barre_liste($langs->trans("ActionsOnCompany"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $newcardbutton, '', 0, 1, 1);
// List of all actions
$filters=array();
$filters['search_agenda_label']=$search_agenda_label;
// TODO Replace this with same code than into list.php
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
}
}
llxFooter();
$db->close();

View File

@ -2209,10 +2209,14 @@ else
print '</div><div class="fichehalfright"><div class="ficheaddleft">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';
$MAXEVENT = 10;
$morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt', DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id);
// List of actions on element // List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db); $formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'contract', $socid, 1); $somethingshown = $formactions->showactions($object, 'contract', $socid, 1, 'listactions', $MAXEVENT, '', $morehtmlright);
print '</div></div></div>'; print '</div></div></div>';
@ -2237,14 +2241,18 @@ $db->close();
<?php <?php
if (! empty($conf->margin->enabled) && $action == 'editline') if (! empty($conf->margin->enabled) && $action == 'editline')
{ {
// TODO Why this ? To manage margin on contracts ?
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
var idprod = $("input[name='idprod']").val(); var idprod = $("input[name='idprod']").val();
var fournprice = $("input[name='fournprice']").val(); var fournprice = $("input[name='fournprice']").val();
var token = '<?php echo $_SESSION["token"]; ?>'; // For AJAX Call we use old 'token' and not 'newtoken'
if (idprod > 0) { if (idprod > 0) {
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {'idprod': idprod}, function(data) { $.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {
'idprod': idprod,
'token': token
}, function(data) {
if (data.length > 0) { if (data.length > 0) {
var options = ''; var options = '';
var trouve=false; var trouve=false;
@ -2289,6 +2297,5 @@ $(document).ready(function() {
} }
}); });
</script> </script>
<?php <?php
} }

View File

@ -517,7 +517,7 @@ if ($resql)
$staticcompany->name=$obj->name; $staticcompany->name=$obj->name;
print $staticcompany->getNomUrl(1, '', 20); print $staticcompany->getNomUrl(1, '', 20);
print '</td>'; print '</td>';
print '<td width="16" class="right"><a href="ligne.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">'; print '<td width="16" class="right"><a href="line.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">';
print $staticcontratligne->LibStatut($obj->statut, 3); print $staticcontratligne->LibStatut($obj->statut, 3);
print '</a></td>'; print '</a></td>';
print "</tr>\n"; print "</tr>\n";
@ -596,7 +596,7 @@ if ($resql)
$staticcompany->name=$obj->name; $staticcompany->name=$obj->name;
print $staticcompany->getNomUrl(1, '', 20); print $staticcompany->getNomUrl(1, '', 20);
print '</td>'; print '</td>';
print '<td width="16" class="right"><a href="ligne.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">'; print '<td width="16" class="right"><a href="line.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">';
print $staticcontratligne->LibStatut($obj->statut, 3, 1); print $staticcontratligne->LibStatut($obj->statut, 3, 1);
print '</a></td>'; print '</a></td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -1,156 +0,0 @@
<?php
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/contrat/info.php
* \ingroup contrat
* \brief Page des informations d'un contrat
*/
require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
// Load translation files required by the page
$langs->load("contracts");
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contrat', $id, '');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('contractcard','globalcard'));
/*
* Actions
*/
// None
/*
* View
*/
$form = new Form($db);
llxHeader('', $langs->trans("Contract"), "");
$object = new Contrat($db);
$object->fetch($id, $ref);
if ($object->id > 0)
{
$object->fetch_thirdparty();
}
$object->info($object->id);
$head = contract_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans("Contract"), -1, 'contract');
// Contract card
$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref='';
//if (! empty($modCodeContract->code_auto)) {
$morehtmlref.=$object->ref;
/*} else {
$morehtmlref.=$form->editfieldkey("",'ref',$object->ref,0,'string','',0,3);
$morehtmlref.=$form->editfieldval("",'ref',$object->ref,0,'string','',0,2);
}*/
$morehtmlref.='<div class="refidno">';
// Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1, 'getFormatedCustomerRef');
// Ref supplier
$morehtmlref.='<br>';
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->contrat->creer)
{
if ($action != 'classify')
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}
$morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'none', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<br>';
print '<table width="100%"><tr><td>';
dol_print_object_info($object);
print '</td></tr></table>';
print '</div>';
dol_fiche_end();
llxFooter();
$db->close();

View File

@ -10,7 +10,7 @@
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016 Bahfir abbes <dolipar@dolipar.org> * Copyright (C) 2016 Bahfir abbes <dolipar@dolipar.org>
* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr> * Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
* Copyright (C) 2017 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 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018 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>
@ -53,6 +53,7 @@ abstract class CommonObject
/** /**
* @var string Error string * @var string Error string
* @see $errors
*/ */
public $error; public $error;
@ -2443,9 +2444,9 @@ abstract class CommonObject
*/ */
public function updateRangOfLine($rowid, $rang) public function updateRangOfLine($rowid, $rang)
{ {
$fieldposition = 'rang'; // @TODO Rename 'rang' and 'position' into 'rank' $fieldposition = 'rang'; // @TODO Rename 'rang' into 'position'
if (in_array($this->table_element_line, array('ecm_files', 'emailcollector_emailcollectoraction'))) $fieldposition = 'position'; if (in_array($this->table_element_line, array('ecm_files', 'emailcollector_emailcollectoraction'))) $fieldposition = 'position';
if (in_array($this->table_element_line, array('bom_bomline'))) $fieldposition = 'rank'; if (in_array($this->table_element_line, array('bom_bomline'))) $fieldposition = 'position';
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET '.$fieldposition.' = '.$rang; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET '.$fieldposition.' = '.$rang;
$sql.= ' WHERE rowid = '.$rowid; $sql.= ' WHERE rowid = '.$rowid;
@ -2749,7 +2750,7 @@ abstract class CommonObject
$MODULE = ""; $MODULE = "";
if ($this->element == 'propal') if ($this->element == 'propal')
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_PROPOSAL"; $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_PROPOSAL";
elseif ($this->element == 'order') elseif ($this->element == 'commande' || $this->element == 'order')
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_ORDER"; $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_ORDER";
elseif ($this->element == 'facture') elseif ($this->element == 'facture')
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_INVOICE"; $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_INVOICE";
@ -6384,7 +6385,7 @@ abstract class CommonObject
* @param array $params Optional parameters. Example: array('style'=>'class="oddeven"', 'colspan'=>$colspan) * @param array $params Optional parameters. Example: array('style'=>'class="oddeven"', 'colspan'=>$colspan)
* @param string $keysuffix Suffix string to add after name and id of field (can be used to avoid duplicate names) * @param string $keysuffix Suffix string to add after name and id of field (can be used to avoid duplicate names)
* @param string $keyprefix Prefix string to add before name and id of field (can be used to avoid duplicate names) * @param string $keyprefix Prefix string to add before name and id of field (can be used to avoid duplicate names)
* @param string $onetrtd All fields in same tr td * @param string $onetrtd All fields in same tr td (TODO field not used ?)
* @return string * @return string
*/ */
public function showOptionals($extrafields, $mode = 'view', $params = null, $keysuffix = '', $keyprefix = '', $onetrtd = 0) public function showOptionals($extrafields, $mode = 'view', $params = null, $keysuffix = '', $keyprefix = '', $onetrtd = 0)
@ -6496,10 +6497,7 @@ abstract class CommonObject
$out .= '<tr id="'.$html_id.'" '.$csstyle.' class="'.$class.$this->element.'_extras_'.$key.' trextrafields_collapse'.$extrafields_collapse_num.'" '.$domData.' >'; $out .= '<tr id="'.$html_id.'" '.$csstyle.' class="'.$class.$this->element.'_extras_'.$key.' trextrafields_collapse'.$extrafields_collapse_num.'" '.$domData.' >';
if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0)
{
if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { $colspan='0'; } if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { $colspan='0'; }
}
if ($action == 'selectlines') { $colspan++; } if ($action == 'selectlines') { $colspan++; }

View File

@ -489,7 +489,10 @@ class Conf
if (empty($this->global->ACCOUNTING_MODE)) $this->global->ACCOUNTING_MODE='RECETTES-DEPENSES'; // By default. Can be 'RECETTES-DEPENSES' ou 'CREANCES-DETTES' if (empty($this->global->ACCOUNTING_MODE)) $this->global->ACCOUNTING_MODE='RECETTES-DEPENSES'; // By default. Can be 'RECETTES-DEPENSES' ou 'CREANCES-DETTES'
// By default, suppliers objects can be linked to all projects // By default, suppliers objects can be linked to all projects
$this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1; if (! isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
// By default we enable feature to bill time spent
if (! isset($this->global->PROJECT_BILL_TIME_SPENT)) $this->global->PROJECT_BILL_TIME_SPENT = 1;
// MAIN_HTML_TITLE // MAIN_HTML_TITLE
if (! isset($this->global->MAIN_HTML_TITLE)) $this->global->MAIN_HTML_TITLE='noapp,thirdpartynameonly,contactnameonly,projectnameonly'; if (! isset($this->global->MAIN_HTML_TITLE)) $this->global->MAIN_HTML_TITLE='noapp,thirdpartynameonly,contactnameonly,projectnameonly';

View File

@ -92,6 +92,7 @@ class CUnits // extends CommonObject
if (isset($this->short_label)) $this->libelle=trim($this->short_label); if (isset($this->short_label)) $this->libelle=trim($this->short_label);
if (isset($this->unit_type)) $this->active=trim($this->unit_type); if (isset($this->unit_type)) $this->active=trim($this->unit_type);
if (isset($this->active)) $this->active=trim($this->active); if (isset($this->active)) $this->active=trim($this->active);
if (isset($this->scale)) $this->scale=trim($this->scale);
// Check parameters // Check parameters
// Put here code to add control on parameters values // Put here code to add control on parameters values
@ -103,12 +104,14 @@ class CUnits // extends CommonObject
$sql.= "label,"; $sql.= "label,";
$sql.= "short_label,"; $sql.= "short_label,";
$sql.= "unit_type"; $sql.= "unit_type";
$sql.= "scale";
$sql.= ") VALUES ("; $sql.= ") VALUES (";
$sql.= " ".(! isset($this->id)?'NULL':"'".$this->db->escape($this->id)."'").","; $sql.= " ".(! isset($this->id)?'NULL':"'".$this->db->escape($this->id)."'").",";
$sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").","; $sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").",";
$sql.= " ".(! isset($this->label)?'NULL':"'".$this->db->escape($this->label)."'").","; $sql.= " ".(! isset($this->label)?'NULL':"'".$this->db->escape($this->label)."'").",";
$sql.= " ".(! isset($this->short_label)?'NULL':"'".$this->db->escape($this->short_label)."'").","; $sql.= " ".(! isset($this->short_label)?'NULL':"'".$this->db->escape($this->short_label)."'").",";
$sql.= " ".(! isset($this->unit_type)?'NULL':"'".$this->db->escape($this->unit_type)."'"); $sql.= " ".(! isset($this->unit_type)?'NULL':"'".$this->db->escape($this->unit_type)."'");
$sql.= " ".(! isset($this->scale)?'NULL':"'".$this->db->escape($this->scale)."'");
$sql.= ")"; $sql.= ")";
$this->db->begin(); $this->db->begin();
@ -173,6 +176,7 @@ class CUnits // extends CommonObject
$sql.= " t.label,"; $sql.= " t.label,";
$sql.= " t.short_label,"; $sql.= " t.short_label,";
$sql.= " t.unit_type,"; $sql.= " t.unit_type,";
$sql.= " t.scale,";
$sql.= " t.active"; $sql.= " t.active";
$sql.= " FROM ".MAIN_DB_PREFIX."c_units as t"; $sql.= " FROM ".MAIN_DB_PREFIX."c_units as t";
$sql_where=array(); $sql_where=array();
@ -196,6 +200,7 @@ class CUnits // extends CommonObject
$this->label = $obj->label; $this->label = $obj->label;
$this->short_label = $obj->short_label; $this->short_label = $obj->short_label;
$this->unit_type = $obj->unit_type; $this->unit_type = $obj->unit_type;
$this->scale = $obj->scale;
$this->active = $obj->active; $this->active = $obj->active;
} }
$this->db->free($resql); $this->db->free($resql);
@ -235,6 +240,7 @@ class CUnits // extends CommonObject
$sql.= " t.label,"; $sql.= " t.label,";
$sql.= " t.short_label,"; $sql.= " t.short_label,";
$sql.= " t.unit_type,"; $sql.= " t.unit_type,";
$sql.= " t.scale,";
$sql.= " t.active"; $sql.= " t.active";
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'c_units as t'; $sql .= ' FROM ' . MAIN_DB_PREFIX . 'c_units as t';
// Manage filter // Manage filter
@ -279,6 +285,7 @@ class CUnits // extends CommonObject
$record->label = $obj->label; $record->label = $obj->label;
$record->short_label = $obj->short_label; $record->short_label = $obj->short_label;
$record->unit_type = $obj->unit_type; $record->unit_type = $obj->unit_type;
$record->scale = $obj->scale;
$record->active = $obj->active; $record->active = $obj->active;
$this->records[$record->id] = $record; $this->records[$record->id] = $record;
} }
@ -312,6 +319,7 @@ class CUnits // extends CommonObject
if (isset($this->label)) $this->libelle=trim($this->label); if (isset($this->label)) $this->libelle=trim($this->label);
if (isset($this->short_label)) $this->libelle=trim($this->short_label); if (isset($this->short_label)) $this->libelle=trim($this->short_label);
if (isset($this->unit_type)) $this->libelle=trim($this->unit_type); if (isset($this->unit_type)) $this->libelle=trim($this->unit_type);
if (isset($this->scale)) $this->scale=trim($this->scale);
if (isset($this->active)) $this->active=trim($this->active); if (isset($this->active)) $this->active=trim($this->active);
// Check parameters // Check parameters
@ -323,6 +331,7 @@ class CUnits // extends CommonObject
$sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").","; $sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").",";
$sql.= " short_label=".(isset($this->short_label)?"'".$this->db->escape($this->short_label)."'":"null").","; $sql.= " short_label=".(isset($this->short_label)?"'".$this->db->escape($this->short_label)."'":"null").",";
$sql.= " unit_type=".(isset($this->unit_type)?"'".$this->db->escape($this->unit_type)."'":"null").","; $sql.= " unit_type=".(isset($this->unit_type)?"'".$this->db->escape($this->unit_type)."'":"null").",";
$sql.= " scale=".(isset($this->scale)?"'".$this->db->escape($this->scale)."'":"null").",";
$sql.= " active=".(isset($this->active)?$this->active:"null"); $sql.= " active=".(isset($this->active)?$this->active:"null");
$sql.= " WHERE rowid=".$this->id; $sql.= " WHERE rowid=".$this->id;

View File

@ -1627,6 +1627,8 @@ class ExtraFields
if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method. if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method.
//if ($computed) $value = // $value is already calculated into $value before calling this method
$showsize=0; $showsize=0;
if ($type == 'date') if ($type == 'date')
{ {

View File

@ -154,7 +154,7 @@ class Form
* @param string $value Value to show/edit * @param string $value Value to show/edit
* @param object $object Object * @param object $object Object
* @param boolean $perm Permission to allow button to edit parameter * @param boolean $perm Permission to allow button to edit parameter
* @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...) * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...')
* @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value * @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value
* @param object $extObject External object * @param object $extObject External object
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
@ -174,7 +174,7 @@ class Form
if (empty($typeofdata)) return 'ErrorBadParameter'; if (empty($typeofdata)) return 'ErrorBadParameter';
// When option to edit inline is activated // When option to edit inline is activated
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/', $typeofdata)) // TODO add jquery timepicker if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/', $typeofdata)) // TODO add jquery timepicker and support select
{ {
$ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg); $ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg);
} }
@ -231,7 +231,8 @@ class Form
foreach($arraydata as $val) foreach($arraydata as $val)
{ {
$tmp=explode(':', $val); $tmp=explode(':', $val);
$arraylist[$tmp[0]]=$tmp[1]; $tmpkey=str_replace('|', ':', $tmp[0]);
$arraylist[$tmpkey]=$tmp[1];
} }
$ret.=$this->selectarray($htmlname, $arraylist, $value); $ret.=$this->selectarray($htmlname, $arraylist, $value);
} }
@ -300,7 +301,7 @@ class Form
* @param string $value Value to show/edit * @param string $value Value to show/edit
* @param string $htmlname DIV ID (field name) * @param string $htmlname DIV ID (field name)
* @param int $condition Condition to edit * @param int $condition Condition to edit
* @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:xxx') * @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:loadmethod:savemethod:buttononly')
* @param string $editvalue When in edit mode, use this value as $value instead of value * @param string $editvalue When in edit mode, use this value as $value instead of value
* @param object $extObject External object * @param object $extObject External object
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
@ -1678,7 +1679,7 @@ class Form
$out .= ajax_combobox($htmlname); $out .= ajax_combobox($htmlname);
// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
$out.= '<select class="flat'.($morecss?' minwidth100 '.$morecss:' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled?' disabled':'').'>'; $out.= '<select class="flat'.($morecss?' minwidth100imp '.$morecss:' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled?' disabled':'').'>';
if ($show_empty && !$multiple) $out.= '<option value="-1"'.((empty($selected) || in_array(-1, $selected))?' selected':'').'>&nbsp;</option>'."\n"; if ($show_empty && !$multiple) $out.= '<option value="-1"'.((empty($selected) || in_array(-1, $selected))?' selected':'').'>&nbsp;</option>'."\n";
if ($show_every) $out.= '<option value="-2"'.((in_array(-2, $selected))?' selected':'').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; if ($show_every) $out.= '<option value="-2"'.((in_array(-2, $selected))?' selected':'').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
@ -2593,7 +2594,7 @@ class Form
} }
$opt.= "</option>\n"; $opt.= "</option>\n";
$optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>$outprice_ht, 'price_ttc'=>$outprice_ttc, 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit); $optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>price2num($outprice_ht), 'price_ttc'=>price2num($outprice_ttc), 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -6617,7 +6618,7 @@ class Form
print '</table>'; print '</table>';
if(!empty($compatibleImportElementsList)) if (!empty($compatibleImportElementsList))
{ {
$res=@include dol_buildpath('core/tpl/ajax/objectlinked_lineimport.tpl.php'); $res=@include dol_buildpath('core/tpl/ajax/objectlinked_lineimport.tpl.php');
} }
@ -6671,7 +6672,8 @@ class Form
'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('intervention').')'), 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('intervention').')'),
'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled , 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled , 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('supplier_proposal').')'),
'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled , 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande_fournisseur').')'), 'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled , 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande_fournisseur').')'),
'invoice_supplier'=>array('enabled'=>$conf->supplier_invoice->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture_fourn').')') 'invoice_supplier'=>array('enabled'=>$conf->supplier_invoice->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture_fourn').')'),
'ticket'=>array('enabled'=>$conf->ticket->enabled , 'perms'=>1, 'label'=>'LinkToTicket', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('ticket').')')
); );
} }

View File

@ -391,7 +391,7 @@ class FormCompany
/** /**
* Return combo list with people title * Return combo list with people title
* *
* @param string $selected Title preselected * @param string $selected Civility/Title code preselected
* @param string $htmlname Name of HTML select combo field * @param string $htmlname Name of HTML select combo field
* @param string $morecss Add more css on SELECT element * @param string $morecss Add more css on SELECT element
* @return string String with HTML select * @return string String with HTML select

View File

@ -130,15 +130,35 @@ class FormFile
$out .= '<td class="valignmiddle nowrap">'; $out .= '<td class="valignmiddle nowrap">';
$max=$conf->global->MAIN_UPLOAD_DOC; // En Kb $max=$conf->global->MAIN_UPLOAD_DOC; // In Kb
$maxphp=@ini_get('upload_max_filesize'); // En inconnu $maxphp=@ini_get('upload_max_filesize'); // In unknown
if (preg_match('/k$/i', $maxphp)) $maxphp=$maxphp*1; if (preg_match('/k$/i', $maxphp)) $maxphp=$maxphp*1;
if (preg_match('/m$/i', $maxphp)) $maxphp=$maxphp*1024; if (preg_match('/m$/i', $maxphp)) $maxphp=$maxphp*1024;
if (preg_match('/g$/i', $maxphp)) $maxphp=$maxphp*1024*1024; if (preg_match('/g$/i', $maxphp)) $maxphp=$maxphp*1024*1024;
if (preg_match('/t$/i', $maxphp)) $maxphp=$maxphp*1024*1024*1024; if (preg_match('/t$/i', $maxphp)) $maxphp=$maxphp*1024*1024*1024;
// Now $max and $maxphp are in Kb $maxphp2=@ini_get('post_max_size'); // In unknown
if (preg_match('/k$/i', $maxphp2)) $maxphp2=$maxphp2*1;
if (preg_match('/m$/i', $maxphp2)) $maxphp2=$maxphp2*1024;
if (preg_match('/g$/i', $maxphp2)) $maxphp2=$maxphp2*1024*1024;
if (preg_match('/t$/i', $maxphp2)) $maxphp2=$maxphp2*1024*1024*1024;
// Now $max and $maxphp and $maxphp2 are in Kb
$maxmin = $max; $maxmin = $max;
if ($maxphp > 0) $maxmin=min($max, $maxphp); $maxphptoshow = $maxphptoshowparam = '';
if ($maxphp > 0)
{
$maxmin=min($max, $maxphp);
$maxphptoshow = $maxphp;
$maxphptoshowparam = 'upload_max_filesize';
}
if ($maxphp2 > 0)
{
$maxmin=min($max, $maxphp2);
if ($maxphp2 < $maxphp)
{
$maxphptoshow = $maxphp2;
$maxphptoshowparam = 'post_max_size';
}
}
if ($maxmin > 0) if ($maxmin > 0)
{ {
@ -168,7 +188,7 @@ class FormFile
{ {
$langs->load('other'); $langs->load('other');
$out .= ' '; $out .= ' ';
$out .= info_admin($langs->trans("ThisLimitIsDefinedInSetup", $max, $maxphp), 1); $out .= info_admin($langs->trans("ThisLimitIsDefinedInSetup", $max, $maxphptoshow), 1);
} }
} }
else else

View File

@ -422,7 +422,7 @@ class FormOther
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) { if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql_usr.= " WHERE u.entity IS NOT NULL"; // Show all users $sql_usr.= " WHERE u.entity IS NOT NULL"; // Show all users
} else { } else {
$sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('user')."))"; $sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('usergroup')."))";
$sql_usr.= " OR u.entity = 0"; // Show always superadmin $sql_usr.= " OR u.entity = 0"; // Show always superadmin
} }
} }
@ -445,7 +445,7 @@ class FormOther
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) { if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql_usr.= " WHERE u2.entity IS NOT NULL"; // Show all users $sql_usr.= " WHERE u2.entity IS NOT NULL"; // Show all users
} else { } else {
$sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('user')."))"; $sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('usergroup')."))";
} }
} }
else else

View File

@ -60,7 +60,7 @@ class FormProjets
* @param int $maxlength Maximum length of label * @param int $maxlength Maximum length of label
* @param int $option_only Return only html options lines without the select tag * @param int $option_only Return only html options lines without the select tag
* @param int $show_empty Add an empty line * @param int $show_empty Add an empty line
* @param int $discard_closed Discard closed projects (0=Keep, 1=hide completely, 2=Disable) * @param int $discard_closed Discard closed projects (0=Keep, 1=hide completely, 2=Disable). Use a negative value to not show the "discarded" tooltip.
* @param int $forcefocus Force focus on field (works with javascript only) * @param int $forcefocus Force focus on field (works with javascript only)
* @param int $disabled Disabled * @param int $disabled Disabled
* @param int $mode 0 for HTML mode and 1 for JSON mode * @param int $mode 0 for HTML mode and 1 for JSON mode
@ -100,13 +100,13 @@ class FormProjets
} }
else else
{ {
$out.=$this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, $discard_closed, $forcefocus, $disabled, 0, $filterkey, 1, $forceaddid, $htmlid, $morecss); $out.=$this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, abs($discard_closed), $forcefocus, $disabled, 0, $filterkey, 1, $forceaddid, $htmlid, $morecss);
} }
if ($discard_closed) if ($discard_closed > 0)
{ {
if (class_exists('Form')) if (class_exists('Form'))
{ {
if (empty($form)) $form=new Form($this->db); if (! is_object($form)) $form=new Form($this->db);
$out.=$form->textwithpicto('', $langs->trans("ClosedProjectsAreHidden")); $out.=$form->textwithpicto('', $langs->trans("ClosedProjectsAreHidden"));
} }
} }
@ -367,7 +367,7 @@ class FormProjets
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
$out.=$comboenhancement; $out.=$comboenhancement;
$morecss='minwidth200 maxwidth500'; $morecss='minwidth200imp maxwidth500';
} }
if (empty($option_only)) { if (empty($option_only)) {

View File

@ -733,6 +733,29 @@ class FormTicket
print ajax_combobox('select'.$htmlname); print ajax_combobox('select'.$htmlname);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Clear list of attached files in send mail form (also stored in session)
*
* @return void
*/
public function clear_attached_files()
{
// phpcs:enable
global $conf,$user;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
// Set tmp user directory
$vardir=$conf->user->dir_output."/".$user->id;
$upload_dir = $vardir.'/temp/'; // TODO Add $keytoavoidconflict in upload_dir path
if (is_dir($upload_dir)) dol_delete_dir_recursive($upload_dir);
$keytoavoidconflict = empty($this->trackid)?'':'-'.$this->trackid; // this->trackid must be defined
unset($_SESSION["listofpaths".$keytoavoidconflict]);
unset($_SESSION["listofnames".$keytoavoidconflict]);
unset($_SESSION["listofmimes".$keytoavoidconflict]);
}
/** /**
* Show the form to add message on ticket * Show the form to add message on ticket
* *
@ -741,32 +764,66 @@ class FormTicket
*/ */
public function showMessageForm($width = '40%') public function showMessageForm($width = '40%')
{ {
global $conf, $langs, $user, $mysoc; global $conf, $langs, $user, $hookmanager, $form, $mysoc;
$formmail = new FormMail($this->db);
$addfileaction = 'addfile';
if (! is_object($form)) $form=new Form($this->db);
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('other', 'mails')); $langs->loadLangs(array('other', 'mails'));
$addfileaction = 'addfile'; // Clear temp files. Must be done at beginning, before call of triggers
if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1'))
{
$this->clear_attached_files();
}
$form = new Form($this->db); // Define output language
$formmail = new FormMail($this->db); $outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $this->param['langsmodels'];
if (! empty($newlang))
{
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
$outputlangs->load('other');
}
// Get message template for $this->param["models"] into c_email_templates
$arraydefaultmessage = -1;
if ($this->param['models'] != 'none')
{
$model_id=0;
if (array_key_exists('models_id', $this->param))
{
$model_id=$this->param["models_id"];
}
$arraydefaultmessage=$formmail->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, $model_id); // If $model_id is empty, preselect the first one
}
// Define list of attached files // Define list of attached files
$listofpaths = array(); $listofpaths = array();
$listofnames = array(); $listofnames = array();
$listofmimes = array(); $listofmimes = array();
if (!empty($_SESSION["listofpaths"])) { $keytoavoidconflict = empty($this->trackid)?'':'-'.$this->trackid; // this->trackid must be defined
$listofpaths = explode(';', $_SESSION["listofpaths"]);
if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1'))
{
if (! empty($arraydefaultmessage->joinfiles) && is_array($this->param['fileinit']))
{
foreach($this->param['fileinit'] as $file)
{
$this->add_attached_files($file, basename($file), dol_mimetype($file));
}
}
} }
if (!empty($_SESSION["listofnames"])) { if (! empty($_SESSION["listofpaths".$keytoavoidconflict])) $listofpaths=explode(';', $_SESSION["listofpaths".$keytoavoidconflict]);
$listofnames = explode(';', $_SESSION["listofnames"]); if (! empty($_SESSION["listofnames".$keytoavoidconflict])) $listofnames=explode(';', $_SESSION["listofnames".$keytoavoidconflict]);
} if (! empty($_SESSION["listofmimes".$keytoavoidconflict])) $listofmimes=explode(';', $_SESSION["listofmimes".$keytoavoidconflict]);
if (!empty($_SESSION["listofmimes"])) {
$listofmimes = explode(';', $_SESSION["listofmimes"]);
}
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
@ -808,6 +865,7 @@ class FormTicket
print '<form method="post" name="ticket" enctype="multipart/form-data" action="' . $this->param["returnurl"] . '">'; print '<form method="post" name="ticket" enctype="multipart/form-data" action="' . $this->param["returnurl"] . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="' . $this->action . '">'; print '<input type="hidden" name="action" value="' . $this->action . '">';
print '<input type="hidden" name="actionbis" value="add_message">';
foreach ($this->param as $key => $value) { foreach ($this->param as $key => $value) {
print '<input type="hidden" name="' . $key . '" value="' . $value . '">'; print '<input type="hidden" name="' . $key . '" value="' . $value . '">';
} }
@ -1000,7 +1058,7 @@ class FormTicket
$out .= '<div id="attachfile_' . $key . '">'; $out .= '<div id="attachfile_' . $key . '">';
$out .= img_mime($listofnames[$key]) . ' ' . $listofnames[$key]; $out .= img_mime($listofnames[$key]) . ' ' . $listofnames[$key];
if (!$this->withfilereadonly) { if (!$this->withfilereadonly) {
$out .= ' <input type="image" style="border: 0px;" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/delete.png" value="' . ($key + 1) . '" class="removedfile" id="removedfile_' . $key . '" name="removedfile_' . $key . '" />'; $out .= ' <input type="image" style="border: 0px;" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/delete.png" value="' . ($key + 1) . '" class="removedfile reposition" id="removedfile_' . $key . '" name="removedfile_' . $key . '" />';
} }
$out .= '<br></div>'; $out .= '<br></div>';
} }

View File

@ -422,7 +422,8 @@ class Menubase
$this->position=''; $this->position='';
$this->url='http://dummy'; $this->url='http://dummy';
$this->target=''; $this->target='';
$this->titre='Specimen menu'; $this->titre='Specimen menu'; // deprecated
$this->title='Specimen menu';
$this->langs=''; $this->langs='';
$this->level=''; $this->level='';
$this->leftmenu=''; $this->leftmenu='';

View File

@ -1261,6 +1261,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", o.ref"; elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", o.ref";
elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", o.ref"; elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", o.ref";
elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') $sql.= ", o.ref"; elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') $sql.= ", o.ref";
elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') $sql.= ", o.ref";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
@ -1284,6 +1285,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", ".MAIN_DB_PREFIX."product as o"; elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", ".MAIN_DB_PREFIX."product as o";
elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", ".MAIN_DB_PREFIX."ticket as o"; elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", ".MAIN_DB_PREFIX."ticket as o";
elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') $sql.= ", ".MAIN_DB_PREFIX."bom_bom as o"; elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') $sql.= ", ".MAIN_DB_PREFIX."bom_bom as o";
elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') $sql.= ", ".MAIN_DB_PREFIX."contrat as o";
$sql.= " WHERE a.entity IN (".getEntity('agenda').")"; $sql.= " WHERE a.entity IN (".getEntity('agenda').")";
if ($force_filter_contact === false) { if ($force_filter_contact === false) {
@ -1314,6 +1316,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'bom'"; $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'bom'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
} }
elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat')
{
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'contract'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
} }
// Condition on actioncode // Condition on actioncode
@ -1368,6 +1375,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
} elseif (empty($sql) && !empty($sql2)) { } elseif (empty($sql) && !empty($sql2)) {
$sql = $sql2; $sql = $sql2;
} }
//TODO Add limit in nb of results //TODO Add limit in nb of results
$sql.= $db->order($sortfield_new, $sortorder); $sql.= $db->order($sortfield_new, $sortorder);
dol_syslog("company.lib::show_actions_done", LOG_DEBUG); dol_syslog("company.lib::show_actions_done", LOG_DEBUG);

View File

@ -30,7 +30,7 @@
*/ */
function contract_prepare_head(Contrat $object) function contract_prepare_head(Contrat $object)
{ {
global $db, $langs, $conf; global $db, $langs, $conf, $user;
$h = 0; $h = 0;
$head = array(); $head = array();
@ -79,9 +79,14 @@ function contract_prepare_head(Contrat $object)
$head[$h][2] = 'documents'; $head[$h][2] = 'documents';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/contrat/info.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id;
$head[$h][1] = $langs->trans("Info"); $head[$h][1].= $langs->trans("Events");
$head[$h][2] = 'info'; if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
{
$head[$h][1].= '/';
$head[$h][1].= $langs->trans("Agenda");
}
$head[$h][2] = 'agenda';
$h++; $h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract', 'remove'); complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract', 'remove');

View File

@ -1559,6 +1559,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
$info = pathinfo($destfile); $info = pathinfo($destfile);
$destfile = dol_sanitizeFileName($info['filename'].($info['extension']!='' ? ('.'.strtolower($info['extension'])) : '')); $destfile = dol_sanitizeFileName($info['filename'].($info['extension']!='' ? ('.'.strtolower($info['extension'])) : ''));
// We apply dol_string_nohtmltag also to clean file names (this remove duplicate spaces) because // We apply dol_string_nohtmltag also to clean file names (this remove duplicate spaces) because
// this function is also applied when we make try to download file (by the GETPOST(filename, 'alphanohtml') call). // this function is also applied when we make try to download file (by the GETPOST(filename, 'alphanohtml') call).
$destfile = dol_string_nohtmltag($destfile); $destfile = dol_string_nohtmltag($destfile);

View File

@ -2947,10 +2947,11 @@ function dol_trunc($string, $size = 40, $trunc = 'right', $stringencoding = 'UTF
* @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip. * @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip.
* @param string $alt Force alt for bind people * @param string $alt Force alt for bind people
* @param string $morecss Add more class css on img tag (For example 'myclascss'). Work only if $moreatt is empty. * @param string $morecss Add more class css on img tag (For example 'myclascss'). Work only if $moreatt is empty.
* @param string $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left maring on picto, 0 = No margin left. Works for fontawesome picto only.
* @return string Return img tag * @return string Return img tag
* @see img_object(), img_picto_common() * @see img_object(), img_picto_common()
*/ */
function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $srconly = 0, $notitle = 0, $alt = '', $morecss = '') function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $srconly = 0, $notitle = 0, $alt = '', $morecss = '', $marginleftonlyshort = 2)
{ {
global $conf, $langs; global $conf, $langs;
@ -2986,7 +2987,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) $fa='fas'; if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) $fa='fas';
$fakey = $pictowithoutext; $fakey = $pictowithoutext;
$facolor = ''; $fasize = ''; $facolor = ''; $fasize = '';
$marginleftonlyshort = 2;
if ($pictowithoutext == 'setup') { if ($pictowithoutext == 'setup') {
$fakey = 'fa-cog'; $fakey = 'fa-cog';
$fasize = '1.4em'; $fasize = '1.4em';

View File

@ -20,7 +20,6 @@
* \ingroup HRM * \ingroup HRM
* \brief Library for hrm * \brief Library for hrm
*/ */
$langs->load('hrm');
/** /**
* Return head table for establishment tabs screen * Return head table for establishment tabs screen
@ -32,6 +31,8 @@ function establishment_prepare_head($object)
{ {
global $langs, $conf; global $langs, $conf;
$langs->load('hrm');
$h = 0; $h = 0;
$head = array(); $head = array();
@ -65,6 +66,8 @@ function hrm_admin_prepare_head()
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
$langs->load('hrm');
$h = 0; $h = 0;
$head = array(); $head = array();

View File

@ -371,7 +371,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
$numlines=count($lines); $numlines=count($lines);
// We declare counter as global because we want to edit them into recursive call // We declare counter as global because we want to edit them into recursive call
global $total_projectlinesa_spent,$total_projectlinesa_planned,$total_projectlinesa_spent_if_planned,$total_projectlinesa_declared_if_planned,$total_projectlinesa_tobill,$total_projectlinesa_billed; global $total_projectlinesa_spent, $total_projectlinesa_planned, $total_projectlinesa_spent_if_planned, $total_projectlinesa_declared_if_planned, $total_projectlinesa_tobill, $total_projectlinesa_billed;
if ($level == 0) if ($level == 0)
{ {
$total_projectlinesa_spent=0; $total_projectlinesa_spent=0;
@ -492,9 +493,13 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
//else print '<a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$lines[$i]->id.'&withproject=1">'; //else print '<a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$lines[$i]->id.'&withproject=1">';
for ($k = 0 ; $k < $level ; $k++) for ($k = 0 ; $k < $level ; $k++)
{ {
print "&nbsp; &nbsp; &nbsp;"; print '<div class="marginleftonly">';
} }
print $lines[$i]->label; print $lines[$i]->label;
for ($k = 0 ; $k < $level ; $k++)
{
print '</div>';
}
if ($showlineingray) print '</i>'; if ($showlineingray) print '</i>';
//else print '</a>'; //else print '</a>';
print "</td>\n"; print "</td>\n";

View File

@ -1,6 +1,7 @@
<?php <?php
/** /**
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com> * Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -32,7 +33,7 @@ function salaries_prepare_head($object)
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/salaries/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/salaries/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
@ -48,13 +49,13 @@ function salaries_prepare_head($object)
$upload_dir = $conf->salaries->dir_output . "/" . dol_sanitizeFileName($object->ref); $upload_dir = $conf->salaries->dir_output . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id); $nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/compta/salaries/document.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/salaries/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents'); $head[$h][1] = $langs->trans('Documents');
if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>';
$head[$h][2] = 'documents'; $head[$h][2] = 'documents';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/salaries/info.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/salaries/info.php?id='.$object->id;
$head[$h][1] = $langs->trans("Info"); $head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
@ -63,3 +64,36 @@ function salaries_prepare_head($object)
return $head; return $head;
} }
/**
* Return array head with list of tabs to view object informations
*
* @return array head
*/
function salaries_admin_prepare_head()
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/salaries/admin/salaries.php';
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'general';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf, $langs, '', $head, $h, 'salaries_admin');
$head[$h][0] = DOL_URL_ROOT.'/salaries/admin/salaries_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsSalaries");
$head[$h][2] = 'attributes';
$h++;
complete_head_from_modules($conf, $langs, '', $head, $h, 'salaries_admin', 'remove');
return $head;
}

View File

@ -185,5 +185,5 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
print '</center><br>'; print '</center><br>';
} }
print '<div style="margin-left: 50px; margin-right: 50px;">'; print '<div class="ticketlargemargin">';
} }

View File

@ -185,7 +185,7 @@ function dolWebsiteOutput($content)
global $db, $langs, $conf, $user; global $db, $langs, $conf, $user;
global $dolibarr_main_url_root, $dolibarr_main_data_root; global $dolibarr_main_url_root, $dolibarr_main_data_root;
dol_syslog("dolWebsiteOutput start (USEDOLIBARRSERVER=".(defined('USEDOLIBARRSERVER')?'1':'')." (USEDOLIBARREDITOR=".(defined('USEDOLIBARREDITOR')?'1':'').')'); dol_syslog("dolWebsiteOutput start (USEDOLIBARRSERVER=".(defined('USEDOLIBARRSERVER')?'1':'')." USEDOLIBARREDITOR=".(defined('USEDOLIBARREDITOR')?'1':'').')');
// Define $urlwithroot // Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
@ -397,7 +397,7 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri
*/ */
function includeContainer($containerref) function includeContainer($containerref)
{ {
global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers. global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running included containers.
global $includehtmlcontentopened; global $includehtmlcontentopened;
global $websitekey, $websitepagefile; global $websitekey, $websitepagefile;
@ -434,7 +434,124 @@ function includeContainer($containerref)
$includehtmlcontentopened--; $includehtmlcontentopened--;
} }
/**
* Return HTML content to add structured data for an article, news or Blog Post.
*
* @param string $type 'blogpost', 'product', 'software'...
* @param array $data Array of data parameters for structured data
* @return string HTML content
*/
function getStructuredData($type, $data = array())
{
global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers.
global $includehtmlcontentopened;
global $websitekey, $websitepagefile;
if ($type == 'software')
{
$ret = '<!-- Add structured data for blog post -->'."\n";
$ret .= '<script type="application/ld+json">'."\n";
$ret .= '{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "'.$data['name'].'",
"operatingSystem": "'.$data['os'].'",
"applicationCategory": "https://schema.org/GameApplication",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "'.$data['ratingvalue'].'",
"ratingCount": "'.$data['ratingcount'].'"
},
"offers": {
"@type": "Offer",
"price": "'.$data['price'].'",
"priceCurrency": "'.($data['currency']?$data['currency']:$conf->currency).'"
}
}'."\n";
$ret .= '</script>'."\n";
}
elseif ($type == 'blogpost')
{
if ($websitepage->fk_user_creat > 0)
{
include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
$tmpuser = new User($db);
$restmpuser = $tmpuser->fetch($websitepage->fk_user_creat);
if ($restmpuser > 0)
{
$ret = '<!-- Add structured data for blog post -->'."\n";
$ret .= '<script type="application/ld+json">'."\n";
$ret .= '{
"@context": "https://schema.org",
"@type": "NewsArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "'.$websitepage->pageurl.'"
},
"headline": "'.$websitepage->title.'",
"image": [
"'.$websitepage->image.'"
],
"datePublished": "'.dol_print_date($websitepage->date_creation, 'dayhourrfc').'",
"dateModified": "'.dol_print_date($websitepage->date_modification, 'dayhourrfc').'",
"author": {
"@type": "Person",
"name": "'.$tmpuser->getFullName($weblangs).'"
},
"publisher": {
"@type": "Organization",
"name": "'.$mysoc->name.'",
"logo": {
"@type": "ImageObject",
"url": "/viewimage.php?modulepart=mycompany&file=logos%2F'.urlencode($mysoc->logo).'"
}
},
"description": "'.$websitepage->description.'"
}'."\n";
$ret .= '</script>'."\n";
}
}
}
elseif ($type == 'product')
{
$ret = '<!-- Add structured data for blog post -->'."\n";
$ret.= '<script type="application/ld+json">'."\n";
$ret.= '{
"@context": "https://schema.org/",
"@type": "Product",
"name": "'.$data['label'].'",
"image": [
"'.$data['image'].'",
],
"description": "'.$data['description'].'",
"sku": "'.$data['ref'].'",
"brand": {
"@type": "Thing",
"name": "'.$data['brand'].'"
},
"author": {
"@type": "Person",
"name": "'.$data['author'].'"
}
},
"offers": {
"@type": "Offer",
"url": "https://example.com/anvil",
"priceCurrency": "'.($data['currency']?$data['currency']:$conf->currency).'",
"price": "'.$data['price'].'",
"itemCondition": "https://schema.org/UsedCondition",
"availability": "https://schema.org/InStock",
"seller": {
"@type": "Organization",
"name": "'.$mysoc->name.'"
}
}
}'."\n";
$ret.= '</script>'."\n";
}
return $ret;
}
/** /**
* Download all images found into page content $tmp. * Download all images found into page content $tmp.

View File

@ -218,10 +218,10 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
-- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?mainmenu=billing&amp;leftmenu=donations', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); -- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?mainmenu=billing&amp;leftmenu=donations', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__);
-- Special expenses -- Special expenses
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?mainmenu=billing&amp;leftmenu=tax', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?mainmenu=billing&amp;leftmenu=tax', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/list.php?mainmenu=billing&amp;leftmenu=tax_salary', 'Salaries', 1, 'salaries', '$user->rights->salaries->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&amp;leftmenu=tax_salary', 'Salaries', 1, 'salaries', '$user->rights->salaries->read', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/card.php?mainmenu=billing&amp;leftmenu=tax_salary&amp;action=create', 'NewPayment', 2, 'companies', '$user->rights->salaries->write', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/card.php?mainmenu=billing&amp;leftmenu=tax_salary&amp;action=create', 'NewPayment', 2, 'companies', '$user->rights->salaries->write', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/list.php?mainmenu=billing&amp;leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&amp;leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/stats/index.php?mainmenu=billing&amp;leftmenu=tax_salary', 'Statistics', 2, 'companies', '$user->rights->salaries->read', '', 0, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/stats/index.php?mainmenu=billing&amp;leftmenu=tax_salary', 'Statistics', 2, 'companies', '$user->rights->salaries->read', '', 0, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/list.php?mainmenu=billing&amp;leftmenu=tax_loan', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/list.php?mainmenu=billing&amp;leftmenu=tax_loan', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?mainmenu=billing&amp;leftmenu=tax_loan&amp;action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?mainmenu=billing&amp;leftmenu=tax_loan&amp;action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__);
--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?mainmenu=billing&amp;leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?mainmenu=billing&amp;leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__);

View File

@ -1108,11 +1108,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if (! empty($conf->salaries->enabled)) if (! empty($conf->salaries->enabled))
{ {
$langs->load("salaries"); $langs->load("salaries");
$newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary&amp;mainmenu=billing", $langs->trans("Salaries"), 1, $user->rights->salaries->read, '', $mainmenu, 'tax_salary'); $newmenu->add("/salaries/list.php?leftmenu=tax_salary&amp;mainmenu=billing", $langs->trans("Salaries"), 1, $user->rights->salaries->read, '', $mainmenu, 'tax_salary');
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) { if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) {
$newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("NewPayment"), 2, $user->rights->salaries->write); $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("NewPayment"), 2, $user->rights->salaries->write);
$newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary", $langs->trans("Payments"), 2, $user->rights->salaries->read); $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("Payments"), 2, $user->rights->salaries->read);
$newmenu->add("/compta/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 2, $user->rights->salaries->read); $newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 2, $user->rights->salaries->read);
} }
} }
@ -1285,7 +1285,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&amp;leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire); $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&amp;leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire);
// Files // Files
if (! empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 1) if ((! empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 1) || ! empty($conf->global->ACCOUNTANCY_SHOW_EXPORT_FILES_MENU))
{ {
$newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&amp;leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire); $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&amp;leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire);
} }
@ -1579,7 +1579,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
{ {
$langs->load("mrp"); $langs->load("mrp");
$newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->service->lire, '', $mainmenu, 'service'); $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom');
$newmenu->add("/bom/bom_card.php?leftmenu=bom&amp;action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write); $newmenu->add("/bom/bom_card.php?leftmenu=bom&amp;action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write);
$newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read); $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read);
} }

View File

@ -1938,7 +1938,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$menu->type=$this->menu[$key]['type']; $menu->type=$this->menu[$key]['type'];
$menu->mainmenu=isset($this->menu[$key]['mainmenu'])?$this->menu[$key]['mainmenu']:(isset($menu->fk_mainmenu)?$menu->fk_mainmenu:''); $menu->mainmenu=isset($this->menu[$key]['mainmenu'])?$this->menu[$key]['mainmenu']:(isset($menu->fk_mainmenu)?$menu->fk_mainmenu:'');
$menu->leftmenu=isset($this->menu[$key]['leftmenu'])?$this->menu[$key]['leftmenu']:''; $menu->leftmenu=isset($this->menu[$key]['leftmenu'])?$this->menu[$key]['leftmenu']:'';
$menu->titre=$this->menu[$key]['titre']; $menu->titre=$this->menu[$key]['titre']; // deprecated
$menu->title=$this->menu[$key]['titre'];
$menu->url=$this->menu[$key]['url']; $menu->url=$this->menu[$key]['url'];
$menu->langs=$this->menu[$key]['langs']; $menu->langs=$this->menu[$key]['langs'];
$menu->position=$this->menu[$key]['position']; $menu->position=$this->menu[$key]['position'];

View File

@ -1217,6 +1217,8 @@ class pdf_einstein extends ModelePDFCommandes
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Show top header of page. * Show top header of page.
* *
@ -1227,8 +1229,9 @@ class pdf_einstein extends ModelePDFCommandes
* @param string $titlekey Translation key to show as title of document * @param string $titlekey Translation key to show as title of document
* @return void * @return void
*/ */
private function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "PdfOrderTitle") protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "PdfOrderTitle")
{ {
// phpcs:enable
global $conf,$langs,$hookmanager; global $conf,$langs,$hookmanager;
// Load traductions files requiredby by page // Load traductions files requiredby by page
@ -1437,6 +1440,8 @@ class pdf_einstein extends ModelePDFCommandes
return $top_shift; return $top_shift;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
@ -1446,8 +1451,9 @@ class pdf_einstein extends ModelePDFCommandes
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text
* @return int Return height of bottom margin including footer text * @return int Return height of bottom margin including footer text
*/ */
private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
{ {
// phpcs:enable
global $conf; global $conf;
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; $showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
return pdf_pagefoot($pdf, $outputlangs, 'ORDER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); return pdf_pagefoot($pdf, $outputlangs, 'ORDER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);

View File

@ -1352,6 +1352,8 @@ class pdf_eratosthene extends ModelePDFCommandes
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Show top header of page. * Show top header of page.
* *
@ -1362,8 +1364,9 @@ class pdf_eratosthene extends ModelePDFCommandes
* @param string $titlekey Translation key to show as title of document * @param string $titlekey Translation key to show as title of document
* @return void * @return void
*/ */
private function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "PdfOrderTitle") protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "PdfOrderTitle")
{ {
// phpcs:enable
global $conf,$langs,$hookmanager; global $conf,$langs,$hookmanager;
// Translations // Translations
@ -1564,6 +1567,8 @@ class pdf_eratosthene extends ModelePDFCommandes
return $top_shift; return $top_shift;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
@ -1573,8 +1578,9 @@ class pdf_eratosthene extends ModelePDFCommandes
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text
* @return int Return height of bottom margin including footer text * @return int Return height of bottom margin including footer text
*/ */
private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
{ {
// phpcs:enable
global $conf; global $conf;
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; $showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
return pdf_pagefoot($pdf, $outputlangs, 'ORDER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); return pdf_pagefoot($pdf, $outputlangs, 'ORDER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);

View File

@ -57,6 +57,8 @@ class pdf_proforma extends pdf_einstein
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Show top header of page. * Show top header of page.
* *
@ -67,8 +69,9 @@ class pdf_proforma extends pdf_einstein
* @param string $titlekey Translation key to show as title of document * @param string $titlekey Translation key to show as title of document
* @return void * @return void
*/ */
private function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "InvoiceProForma") protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "InvoiceProForma")
{ {
// phpcs:enable
global $conf,$langs,$hookmanager; global $conf,$langs,$hookmanager;
parent::_pagehead($pdf, $object, $showaddress, $outputlangs, $titlekey); parent::_pagehead($pdf, $object, $showaddress, $outputlangs, $titlekey);

View File

@ -414,7 +414,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
} }
} }
// Make substitutions into odt of thirdparty // Make substitutions into odt of thirdparty
$tmparray=$this->get_substitutionarray_thirdparty($socobject, $outputlangs); if ($socobject->element == 'contact') {
$tmparray = $this->get_substitutionarray_contact($socobject, $outputlangs);
} else {
$tmparray = $this->get_substitutionarray_thirdparty($socobject, $outputlangs);
}
foreach($tmparray as $key=>$value) foreach($tmparray as $key=>$value)
{ {
try { try {

View File

@ -29,6 +29,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
/** /**

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