Merge branch '18.0' into 18_fix_search_ticket_list
This commit is contained in:
commit
2cbede2ef8
74 changed files with 615 additions and 217 deletions
3
.github/changed-lines-count-labeler.yml
vendored
Normal file
3
.github/changed-lines-count-labeler.yml
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Add this tag for any changes for more than 1 line
|
||||
"Pending analysis of PR (maintenance team)":
|
||||
min: 1
|
||||
21
.github/workflows/pr-18-autolabel.yaml
vendored
Normal file
21
.github/workflows/pr-18-autolabel.yaml
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
name: "Set label for v18"
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
branches:
|
||||
- "18.0"
|
||||
push:
|
||||
branches:
|
||||
- "18.0"
|
||||
|
||||
jobs:
|
||||
changed-lines-count-labeler:
|
||||
runs-on: ubuntu-latest
|
||||
name: An action for automatically labelling pull requests based on the changed lines count
|
||||
steps:
|
||||
- name: Set a label
|
||||
uses: vkirilichev/changed-lines-count-labeler@v0.2
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
configuration-path: .github/changed-lines-count-labeler.yml
|
||||
continue-on-error: true
|
||||
44
.github/workflows/pr-18.yaml
vendored
44
.github/workflows/pr-18.yaml
vendored
|
|
@ -1,3 +1,4 @@
|
|||
name: Set reviewer for v18
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
|
@ -7,36 +8,47 @@ on:
|
|||
branches:
|
||||
- "18.0"
|
||||
|
||||
permissions: write-all
|
||||
|
||||
jobs:
|
||||
run:
|
||||
pr18:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
# GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
#env:
|
||||
# GH_TOKEN: ${{ github.token }}
|
||||
# GH_TOKENS: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install GitHub CLI
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install gh -y
|
||||
|
||||
#- name: Authenticate GitHub CLI
|
||||
#- name: Install GitHub CLI
|
||||
# run: |
|
||||
# echo "GH_TOKEN=$GH_TOKEN"
|
||||
# gh auth login --with-token <<< "$GH_TOKEN"
|
||||
# sudo apt update
|
||||
# sudo apt install gh -y
|
||||
|
||||
- name: Assign reviewer
|
||||
- name: Assign reviewer method 1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
url: ${{ github.event.pull_request.html_url }}
|
||||
run: |
|
||||
gh pr edit "$url" --add-assignee rycks --add-reviewer rycks
|
||||
gh pr merge "$url" --merge --auto
|
||||
continue-on-error: true
|
||||
|
||||
- name: Assign reviewer method 2
|
||||
env:
|
||||
#REVIEWER: "eldy,lvessiller-opendsi,rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer
|
||||
REVIEWER: "rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer
|
||||
run: |
|
||||
echo "GH_TOKEN=$GH_TOKEN"
|
||||
echo "Run action by ${{ github.actor }}"
|
||||
echo "github.token=${{ github.token }}"
|
||||
echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
|
||||
echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH"
|
||||
echo Get the pr_number
|
||||
pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH)
|
||||
echo "pr_number=$pr_number"
|
||||
echo Authenticate login gh
|
||||
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
|
||||
gh auth setup-git
|
||||
echo Set the reviewer
|
||||
gh pr edit $pr_number --add-reviewer "$REVIEWER"
|
||||
continue-on-error: true
|
||||
|
|
|
|||
33
.github/workflows/pre-commit.yml
vendored
33
.github/workflows/pre-commit.yml
vendored
|
|
@ -42,6 +42,21 @@ jobs:
|
|||
with:
|
||||
path: ~/.cache/pre-commit/
|
||||
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
||||
|
||||
- name: Extract PHP version
|
||||
id: extract-php-version
|
||||
run: |
|
||||
PHP_VERSION=$(sed -n 's/.*\$arrayphpmaxversionwarning\s*=\s*array\s*(\s*\([0-9]\+\)\s*,\s*\([0-9]\+\).*/\1.\2/p' htdocs/install/check.php)
|
||||
echo "PHP_VERSION=$PHP_VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup PHPCS
|
||||
uses: shivammathur/setup-php@v2
|
||||
# Install proper php version, and also install phpcs which may be needed
|
||||
with:
|
||||
php-version: ${{ env.PHP_VERSION }} # Version from check.php
|
||||
coverage: none # disable xdebug, pcov
|
||||
tools: phpcs
|
||||
|
||||
# Run all the precommit tools (defined into pre-commit-config.yaml).
|
||||
# We can force exclusion of some of them here.
|
||||
- name: Run pre-commit hooks
|
||||
|
|
@ -62,24 +77,6 @@ jobs:
|
|||
# files: |
|
||||
# **.php
|
||||
|
||||
- name: Setup PHPCS
|
||||
uses: shivammathur/setup-php@v2
|
||||
# Install when we're going to run phpcs
|
||||
if: |
|
||||
steps.changed-php.outputs.any_changed == 'true'
|
||||
||
|
||||
(
|
||||
github.event_name == 'push'
|
||||
&& (
|
||||
github.event.ref == 'refs/heads/develop'
|
||||
|| endsWith(github.event.ref, '.0')
|
||||
)
|
||||
)
|
||||
with:
|
||||
php-version: 8.1
|
||||
coverage: none # disable xdebug, pcov
|
||||
tools: phpcs
|
||||
|
||||
- name: Run some pre-commit hooks on selected changed files only
|
||||
if: steps.changed-php.outputs.any_changed == 'true'
|
||||
env:
|
||||
|
|
|
|||
2
.github/workflows/stale-issues-safe.yml
vendored
2
.github/workflows/stale-issues-safe.yml
vendored
|
|
@ -8,7 +8,7 @@ on:
|
|||
types: [created]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: {} # none
|
||||
permissions: {} # no restriction by default
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
|
|
|
|||
23
.github/workflows/test.yaml
vendored
23
.github/workflows/test.yaml
vendored
|
|
@ -1,11 +1,16 @@
|
|||
name: Test github actions
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
branches:
|
||||
- "18.0"
|
||||
push:
|
||||
|
||||
permissions: write-all
|
||||
env:
|
||||
ENVGHT: ${{ secrets.GITHUB_TOKEN }}
|
||||
ENVGHU: ${{ github.token }}
|
||||
TEST_ACCESS_KEY: ${{ secrets.TEST_ACCESS_KEY }}
|
||||
TEST_VAR_REPO: ${{ vars.TEST_VAR_REPO }}
|
||||
ENVLOCAL: "varenvlocal"
|
||||
|
||||
jobs:
|
||||
testjob:
|
||||
|
|
@ -13,7 +18,11 @@ jobs:
|
|||
steps:
|
||||
- name: Log
|
||||
run: |
|
||||
echo "variable org: ${{vars.AAA}}"
|
||||
echo "env prg: ${{env.AAA}}"
|
||||
echo "secret org: ${{secrets.BBB}}"
|
||||
echo "variable repository of orga: ${{vars.CCC}}"
|
||||
echo "Run action by ${{ github.actor }}"
|
||||
echo "github.token=${{ github.token }}"
|
||||
echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
|
||||
echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH"
|
||||
echo "repo-token: ${{secrets.GITHUB_TOKEN}}"
|
||||
echo "secret repository TEST_ACCESS_KEY: ${{secrets.TEST_ACCESS_KEY}}"
|
||||
echo "variable repository : ${{vars.TEST_VAR_REPO}}"
|
||||
echo "ENVLOCAL: ${{env.ENVLOCAL}}"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ repos:
|
|||
rev: v4.5.0
|
||||
hooks:
|
||||
- id: no-commit-to-branch
|
||||
args: [--branch, develop, --pattern, \d+.0]
|
||||
args: [--branch, develop, --pattern, \d+.0$]
|
||||
- id: check-yaml
|
||||
args: [--unsafe]
|
||||
- id: check-json
|
||||
|
|
@ -81,6 +81,8 @@ repos:
|
|||
]
|
||||
pass_filenames: false # Run on all files
|
||||
- id: php-lint
|
||||
exclude:
|
||||
(?x)^(htdocs/includes/symfony/var-dumper/Tests/.*)$
|
||||
- id: php-stan
|
||||
stages: [manual]
|
||||
files: \.(php)$
|
||||
|
|
|
|||
|
|
@ -348,6 +348,12 @@ class Members extends DolibarrApi
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$member->array_options[$index] = $this->_checkValForAPI($field, $val, $member);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$member->$field = $value;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,6 +193,12 @@ class MembersTypes extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$membertype->array_options[$index] = $this->_checkValForAPI($field, $val, $membertype);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// Process the status separately because it must be updated using
|
||||
// the validate(), resiliate() and exclude() methods of the class AdherentType.
|
||||
$membertype->$field = $value;
|
||||
|
|
|
|||
|
|
@ -186,6 +186,12 @@ class Subscriptions extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$subscription->array_options[$index] = $this->_checkValForAPI($field, $val, $subscription);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$subscription->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -240,6 +240,12 @@ class Boms extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->bom->array_options[$index] = $this->_checkValForAPI($field, $val, $this->bom);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->bom->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -237,6 +237,12 @@ class Categories extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->category->array_options[$index] = $this->_checkValForAPI($field, $val, $this->category);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->category->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1960,7 +1960,12 @@ if ($id > 0) {
|
|||
// related contact
|
||||
print '<tr><td>'.$langs->trans("ActionOnContact").'</td><td>';
|
||||
print '<div class="maxwidth200onsmartphone">';
|
||||
print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(empty($conf->global->MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT) ? $object->socid : 0, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid');
|
||||
if (getDolGlobalInt('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT')) {
|
||||
$select_contact_default = 0; // select "all" contacts by default : avoid to use it if there is a lot of contacts
|
||||
} else {
|
||||
$select_contact_default = -1; // select "none" by default
|
||||
}
|
||||
print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(!empty($object->socid) ? $object->socid : $select_contact_default, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid');
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -619,7 +619,7 @@ class ActionComm extends CommonObject
|
|||
foreach ($this->userassigned as $key => $val) {
|
||||
// Common value with new behavior is to have $val = array('id'=>iduser, 'transparency'=>0|1) and $this->userassigned is an array of iduser => $val.
|
||||
if (!is_array($val)) { // For backward compatibility when $val='id'.
|
||||
$val = array('id'=>$val);
|
||||
$val = array('id' => $val);
|
||||
}
|
||||
|
||||
if ($val['id'] > 0) {
|
||||
|
|
@ -1258,9 +1258,11 @@ class ActionComm extends CommonObject
|
|||
$already_inserted = array();
|
||||
foreach (array_keys($this->socpeopleassigned) as $key => $val) {
|
||||
if (!is_array($val)) { // For backward compatibility when val=id
|
||||
$val = array('id'=>$val);
|
||||
$val = array('id' => $val);
|
||||
}
|
||||
if (!empty($already_inserted[$val['id']])) {
|
||||
continue;
|
||||
}
|
||||
if (!empty($already_inserted[$val['id']])) continue;
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
|
||||
$sql .= " VALUES(".((int) $this->id).", 'socpeople', ".((int) $val['id']).", 0, 0, 0)";
|
||||
|
|
|
|||
|
|
@ -270,6 +270,12 @@ class AgendaEvents extends DolibarrApi
|
|||
continue;
|
||||
}
|
||||
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->actioncomm->array_options[$index] = $this->_checkValForAPI($field, $val, $this->actioncomm);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->actioncomm->$field = $this->_checkValForAPI($field, $value, $this->actioncomm);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ if (!$sortorder) {
|
|||
$sortorder = "ASC";
|
||||
}
|
||||
if (!$sortfield) {
|
||||
$sortfield = "p.name";
|
||||
$sortfield = "p.lastname";
|
||||
}
|
||||
if ($page < 0) {
|
||||
$page = 0;
|
||||
|
|
@ -81,7 +81,7 @@ if ($type == "f") {
|
|||
*/
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, st.libelle as stcomm";
|
||||
$sql .= ", p.rowid as cidp, p.name, p.firstname, p.email, p.phone";
|
||||
$sql .= ", p.rowid as cidp, p.lastname, p.firstname, p.email, p.phone";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st,";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
$sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
|
||||
|
|
@ -106,7 +106,7 @@ if ($socid) {
|
|||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
}
|
||||
if (!empty($search_lastname)) {
|
||||
$sql .= " AND p.name LIKE '%".$db->escape($search_lastname)."%'";
|
||||
$sql .= " AND p.lastname LIKE '%".$db->escape($search_lastname)."%'";
|
||||
}
|
||||
if (!empty($search_firstname)) {
|
||||
$sql .= " AND p.firstname LIKE '%".$db->escape($search_firstname)."%'";
|
||||
|
|
@ -115,8 +115,8 @@ if (!empty($search_company)) {
|
|||
$sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'";
|
||||
}
|
||||
if (!empty($contactname)) { // acces a partir du module de recherche
|
||||
$sql .= " AND (p.name LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') ";
|
||||
$sortfield = "p.name";
|
||||
$sql .= " AND (p.lastname LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') ";
|
||||
$sortfield = "p.lastname";
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
|
||||
|
|
@ -136,7 +136,7 @@ if ($resql) {
|
|||
|
||||
print '<table class="liste centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.name", $begin, $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.lastname", $begin, $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Firstname", $_SERVER["PHP_SELF"], "p.firstname", $begin, $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", $begin, $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Email");
|
||||
|
|
|
|||
|
|
@ -695,6 +695,12 @@ class Proposals extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->propal->array_options[$index] = $this->_checkValForAPI($field, $val, $this->propal);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->propal->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -653,6 +653,12 @@ class Orders extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->commande->array_options[$index] = $this->_checkValForAPI($field, $val, $this->commande);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->commande->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -332,6 +332,12 @@ class BankAccounts extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$account->array_options[$index] = $this->_checkValForAPI($field, $val, $account);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$account->$field = $this->_checkValForAPI($field, $value, $account);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,10 @@ $pagenext = $page + 1;
|
|||
$object = new FactureRec($db);
|
||||
if (($id > 0 || $ref) && $action != 'create' && $action != 'add') {
|
||||
$ret = $object->fetch($id, $ref);
|
||||
if (!$ret) {
|
||||
if ($ret < 0) {
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
exit;
|
||||
} elseif (! $ret) {
|
||||
setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -1304,14 +1307,10 @@ if ($action == 'create') {
|
|||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE) {
|
||||
if ($action == 'editconditions') {
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
|
||||
} else {
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none');
|
||||
}
|
||||
if ($action == 'editconditions') {
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
|
||||
} else {
|
||||
print ' ';
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -1735,6 +1734,7 @@ if ($action == 'create') {
|
|||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$morehtmlcenter = '';
|
||||
$somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -622,6 +622,12 @@ class Invoices extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->invoice->array_options[$index] = $this->_checkValForAPI($field, $val, $this->invoice);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->invoice->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1397,6 +1397,7 @@ class FactureRec extends CommonInvoice
|
|||
$nb_create++;
|
||||
$this->output .= $langs->trans("InvoiceGeneratedFromTemplate", $facture->ref, $facturerec->ref)."\n";
|
||||
} else {
|
||||
$this->output .= $langs->trans("InvoiceGeneratedFromTemplateError", $facture->ref, $facturerec->ref, $this->error)."\n";
|
||||
$this->db->rollback("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,11 +89,8 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
|||
$totalallpayments = 0;
|
||||
$totalcalculated = false;
|
||||
if (method_exists($objectlink, 'getSommePaiement')) {
|
||||
print $objectlink->getLibStatut(3, $objectlink->getSommePaiement());
|
||||
$totalcalculated = true;
|
||||
$totalallpayments += $objectlink->getSommePaiement();
|
||||
} else {
|
||||
print $objectlink->getLibStatut(3);
|
||||
}
|
||||
if (method_exists($objectlink, 'getSumDepositsUsed')) {
|
||||
$totalcalculated = true;
|
||||
|
|
|
|||
|
|
@ -509,6 +509,12 @@ class Contracts extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->contract->array_options[$index] = $this->_checkValForAPI($field, $val, $this->contract);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->contract->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -686,7 +686,7 @@ class CMailFile
|
|||
$this->error = "Error in hook maildao sendMail ".$reshook;
|
||||
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
|
||||
|
||||
return $reshook;
|
||||
return false;
|
||||
}
|
||||
if ($reshook == 1) { // Hook replace standard code
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -4058,8 +4058,12 @@ abstract class CommonObject
|
|||
$classpath = 'adherents/class';
|
||||
$module = 'adherent';
|
||||
} elseif ($objecttype == 'contact') {
|
||||
$module = 'societe';
|
||||
$module = 'societe';
|
||||
} elseif ($objecttype == 'action') {
|
||||
$module = 'agenda';
|
||||
$subelement = 'actionComm';
|
||||
}
|
||||
|
||||
// Set classfile
|
||||
$classfile = strtolower($subelement);
|
||||
$classname = ucfirst($subelement);
|
||||
|
|
|
|||
|
|
@ -580,7 +580,7 @@ class Translate
|
|||
*/
|
||||
private function getTradFromKey($key)
|
||||
{
|
||||
global $conf, $db;
|
||||
global $db;
|
||||
|
||||
if (!is_string($key)) {
|
||||
//xdebug_print_function_stack('ErrorBadValueForParamNotAString');
|
||||
|
|
@ -660,7 +660,7 @@ class Translate
|
|||
}
|
||||
}
|
||||
|
||||
// Crypt string into HTML
|
||||
// Encode string into HTML
|
||||
$str = htmlentities($str, ENT_COMPAT, $this->charset_output); // Do not convert simple quotes in translation (strings in html are embraced by "). Use dol_escape_htmltag around text in HTML content
|
||||
|
||||
// Restore reliable HTML tags into original translation string
|
||||
|
|
@ -670,6 +670,10 @@ class Translate
|
|||
$str
|
||||
);
|
||||
|
||||
// Remove dangerous sequence we should never have. Not needed into a translated response.
|
||||
// %27 is entity code for ' and is replaced by browser automatically when translation is inside a javascript code called by a click like on a href link.
|
||||
$str = str_replace(array('%27', '''), '', $str);
|
||||
|
||||
if ($maxsize) {
|
||||
$str = dol_trunc($str, $maxsize);
|
||||
}
|
||||
|
|
@ -739,6 +743,10 @@ class Translate
|
|||
$str = sprintf($str, $param1, $param2, $param3, $param4, $param5); // Replace %s and %d except for FormatXXX strings.
|
||||
}
|
||||
|
||||
// Remove dangerous sequence we should never have. Not needed into a translated response.
|
||||
// %27 is entity code for ' and is replaced by browser automatically when translation is inside a javascript code called by a click like on a href link.
|
||||
$str = str_replace(array('%27', '''), '', $str);
|
||||
|
||||
return $str;
|
||||
} else {
|
||||
/*if ($key[0] == '$') {
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ if (!class_exists('MenuManager')) {
|
|||
$menufound = 0;
|
||||
$dirmenus = array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']);
|
||||
foreach ($dirmenus as $dirmenu) {
|
||||
$menufound = dol_include_once($dirmenu."standard/".$file_menu);
|
||||
$menufound = dol_include_once($dirmenu."standard/".dol_sanitizeFileName($file_menu));
|
||||
if ($menufound) {
|
||||
break;
|
||||
}
|
||||
|
|
@ -260,7 +260,7 @@ if (!class_exists('MenuManager')) {
|
|||
if (!$menufound) { // If failed to include, we try with standard
|
||||
dol_syslog("You define a menu manager '".$file_menu."' that can not be loaded.", LOG_WARNING);
|
||||
$file_menu = 'eldy_menu.php';
|
||||
include_once DOL_DOCUMENT_ROOT."/core/menus/standard/".$file_menu;
|
||||
include_once DOL_DOCUMENT_ROOT."/core/menus/standard/".dol_sanitizeFileName($file_menu);
|
||||
}
|
||||
}
|
||||
$menumanager = new MenuManager($db, empty($user->socid) ? 0 : 1);
|
||||
|
|
|
|||
|
|
@ -996,7 +996,7 @@ function document_preview(file, type, title)
|
|||
var ValidImageTypes = ["image/gif", "image/jpeg", "image/png", "image/webp"];
|
||||
var showOriginalSizeButton = false;
|
||||
|
||||
console.log("document_preview A click was done. file="+file+", type="+type+", title="+title);
|
||||
console.log("document_preview A click was done: file="+file+", type="+type+", title="+title);
|
||||
|
||||
if ($.inArray(type, ValidImageTypes) < 0) {
|
||||
/* Not an image */
|
||||
|
|
|
|||
|
|
@ -1448,6 +1448,7 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
|
|||
}
|
||||
}
|
||||
} else {
|
||||
$ok = false; // to avoid false positive
|
||||
dol_syslog("No files to delete found", LOG_DEBUG);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1818,8 +1818,10 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
|
|||
if (!empty($message)) {
|
||||
// Test log level
|
||||
$logLevels = array(LOG_EMERG=>'EMERG', LOG_ALERT=>'ALERT', LOG_CRIT=>'CRITICAL', LOG_ERR=>'ERR', LOG_WARNING=>'WARN', LOG_NOTICE=>'NOTICE', LOG_INFO=>'INFO', LOG_DEBUG=>'DEBUG');
|
||||
|
||||
if (!array_key_exists($level, $logLevels)) {
|
||||
throw new Exception('Incorrect log level');
|
||||
dol_syslog('Error Bad Log Level '.$level, LOG_ERR);
|
||||
$level = $logLevels[LOG_ERR];
|
||||
}
|
||||
if ($level > getDolGlobalInt('SYSLOG_LEVEL')) {
|
||||
return;
|
||||
|
|
@ -9153,10 +9155,11 @@ function dol_osencode($str)
|
|||
* @param string $fieldid Field to get
|
||||
* @param int $entityfilter Filter by entity
|
||||
* @param string $filters Filters to add. WARNING: string must be escaped for SQL and not coming from user input.
|
||||
* @param bool $useCache If true (default), cache will be queried and updated.
|
||||
* @return int <0 if KO, Id of code if OK
|
||||
* @see $langs->getLabelFromKey
|
||||
*/
|
||||
function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = 'id', $entityfilter = 0, $filters = '')
|
||||
function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = 'id', $entityfilter = 0, $filters = '', $useCache = true)
|
||||
{
|
||||
global $cache_codes;
|
||||
|
||||
|
|
@ -9166,8 +9169,8 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid =
|
|||
}
|
||||
|
||||
// Check in cache
|
||||
if (isset($cache_codes[$tablename][$key][$fieldid])) { // Can be defined to 0 or ''
|
||||
return $cache_codes[$tablename][$key][$fieldid]; // Found in cache
|
||||
if ($useCache && isset($cache_codes[$tablename][$fieldkey][$fieldid][$entityfilter][$filters][$key])) { // Can be defined to 0 or ''
|
||||
return $cache_codes[$tablename][$fieldkey][$fieldid][$entityfilter][$filters][$key]; // Found in cache
|
||||
}
|
||||
|
||||
dol_syslog('dol_getIdFromCode (value for field '.$fieldid.' from key '.$key.' not found into cache)', LOG_DEBUG);
|
||||
|
|
@ -9185,13 +9188,15 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid =
|
|||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$valuetoget = '';
|
||||
if ($obj) {
|
||||
$cache_codes[$tablename][$key][$fieldid] = $obj->valuetoget;
|
||||
} else {
|
||||
$cache_codes[$tablename][$key][$fieldid] = '';
|
||||
$valuetoget = $obj->valuetoget;
|
||||
}
|
||||
$db->free($resql);
|
||||
return $cache_codes[$tablename][$key][$fieldid];
|
||||
if ($useCache) {
|
||||
$cache_codes[$tablename][$fieldkey][$fieldid][$entityfilter][$filters][$key] = $valuetoget;
|
||||
}
|
||||
return $valuetoget;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -10363,7 +10368,7 @@ function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata = 0, $param
|
|||
|
||||
if ($alldata == 1) {
|
||||
if ($isAllowedForPreview) {
|
||||
return array('target'=>'_blank', 'css'=>'documentpreview', 'url'=>DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : ''), 'mime'=>dol_mimetype($relativepath));
|
||||
return array('target'=>'_blank', 'css'=>'documentpreview', 'url'=>DOL_URL_ROOT.'/document.php?modulepart='.urlencode($modulepart).'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : ''), 'mime'=>dol_mimetype($relativepath));
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
|
|
@ -10371,7 +10376,14 @@ function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata = 0, $param
|
|||
|
||||
// old behavior, return a string
|
||||
if ($isAllowedForPreview) {
|
||||
return 'javascript:document_preview(\''.dol_escape_js(DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : '')).'\', \''.dol_mimetype($relativepath).'\', \''.dol_escape_js($langs->trans('Preview')).'\')';
|
||||
$tmpurl = DOL_URL_ROOT.'/document.php?modulepart='.urlencode($modulepart).'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : '');
|
||||
$title = $langs->transnoentities("Preview");
|
||||
//$title = '%27-alert(document.domain)-%27';
|
||||
//$tmpurl = 'file='.urlencode("'-alert(document.domain)-'_small.jpg");
|
||||
|
||||
// We need to urlencode the parameter after the dol_escape_js($tmpurl) because $tmpurl may contain n url with param file=abc%27def if file has a ' inside.
|
||||
// and when we click on href with this javascript string, a urlcode is done by browser, converted the %27 of file param
|
||||
return 'javascript:document_preview(\''.urlencode(dol_escape_js($tmpurl)).'\', \''.urlencode(dol_mimetype($relativepath)).'\', \''.rawurlencode(dol_escape_js($title)).'\')';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
|
@ -11149,11 +11161,11 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
|||
* 'classOverride' => '' // to replace class attribute of the button
|
||||
* ],
|
||||
* 'confirm' => [
|
||||
* 'url' => 'http://', // Overide Url to go when user click on action btn, if empty default url is $url.?confirm=yes, for no js compatibility use $url for fallback confirm.
|
||||
* 'title' => '', // Overide title of modal, if empty default title use "ConfirmBtnCommonTitle" lang key
|
||||
* 'action-btn-label' => '', // Overide label of action button, if empty default label use "Confirm" lang key
|
||||
* 'cancel-btn-label' => '', // Overide label of cancel button, if empty default label use "CloseDialog" lang key
|
||||
* 'content' => '', // Overide text of content, if empty default content use "ConfirmBtnCommonContent" lang key
|
||||
* 'url' => 'http://', // Override Url to go when user click on action btn, if empty default url is $url.?confirm=yes, for no js compatibility use $url for fallback confirm.
|
||||
* 'title' => '', // Override title of modal, if empty default title use "ConfirmBtnCommonTitle" lang key
|
||||
* 'action-btn-label' => '', // Override label of action button, if empty default label use "Confirm" lang key
|
||||
* 'cancel-btn-label' => '', // Override label of cancel button, if empty default label use "CloseDialog" lang key
|
||||
* 'content' => '', // Override text of content, if empty default content use "ConfirmBtnCommonContent" lang key
|
||||
* 'modal' => true, // true|false to display dialog as a modal (with dark background)
|
||||
* 'isDropDrown' => false, // true|false to display dialog as a dropdown (with dark background)
|
||||
* ],
|
||||
|
|
|
|||
|
|
@ -1425,12 +1425,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
|||
{
|
||||
global $db, $conf, $langs;
|
||||
|
||||
$idprod = (!empty($object->lines[$i]->fk_product) ? $object->lines[$i]->fk_product : false);
|
||||
$label = (!empty($object->lines[$i]->label) ? $object->lines[$i]->label : (!empty($object->lines[$i]->product_label) ? $object->lines[$i]->product_label : ''));
|
||||
$desc = (!empty($object->lines[$i]->desc) ? $object->lines[$i]->desc : (!empty($object->lines[$i]->description) ? $object->lines[$i]->description : ''));
|
||||
$ref_supplier = (!empty($object->lines[$i]->ref_supplier) ? $object->lines[$i]->ref_supplier : (!empty($object->lines[$i]->ref_fourn) ? $object->lines[$i]->ref_fourn : '')); // TODO Not yet saved for supplier invoices, only supplier orders
|
||||
$note = (!empty($object->lines[$i]->note) ? $object->lines[$i]->note : '');
|
||||
$dbatch = (!empty($object->lines[$i]->detail_batch) ? $object->lines[$i]->detail_batch : false);
|
||||
$multilangsactive = getDolGlobalInt('MAIN_MULTILANGS');
|
||||
|
||||
if ($issupplierline) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
|
|
@ -1444,10 +1439,54 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
|||
}
|
||||
}
|
||||
|
||||
//id
|
||||
$idprod = (!empty($object->lines[$i]->fk_product) ? $object->lines[$i]->fk_product : false);
|
||||
if ($idprod) {
|
||||
$prodser->fetch($idprod);
|
||||
//load multilangs
|
||||
if ($multilangsactive) {
|
||||
$prodser->getMultiLangs();
|
||||
$object->lines[$i]->multilangs = $prodser->multilangs;
|
||||
}
|
||||
}
|
||||
//label
|
||||
if (!empty($object->lines[$i]->label)) {
|
||||
$label = $object->lines[$i]->label;
|
||||
} else {
|
||||
if (!empty($object->lines[$i]->multilangs[$outputlangs->defaultlang]['label']) && $multilangsactive) {
|
||||
$label = $object->lines[$i]->multilangs[$outputlangs->defaultlang]['label'];
|
||||
} else {
|
||||
if (!empty($object->lines[$i]->product_label)) {
|
||||
$label = $object->lines[$i]->product_label;
|
||||
} else {
|
||||
$label = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
//description
|
||||
if (!empty($object->lines[$i]->desc)) {
|
||||
$desc = $object->lines[$i]->desc;
|
||||
} else {
|
||||
if (!empty($object->lines[$i]->multilangs[$outputlangs->defaultlang]['description']) && $multilangsactive) {
|
||||
$desc = $object->lines[$i]->multilangs[$outputlangs->defaultlang]['description'];
|
||||
} else {
|
||||
if (!empty($object->lines[$i]->description)) {
|
||||
$desc = $object->lines[$i]->description;
|
||||
} else {
|
||||
$desc = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
//ref supplier
|
||||
$ref_supplier = (!empty($object->lines[$i]->ref_supplier) ? $object->lines[$i]->ref_supplier : (!empty($object->lines[$i]->ref_fourn) ? $object->lines[$i]->ref_fourn : '')); // TODO Not yet saved for supplier invoices, only supplier orders
|
||||
//note
|
||||
$note = (!empty($object->lines[$i]->note) ? $object->lines[$i]->note : '');
|
||||
//dbatch
|
||||
$dbatch = (!empty($object->lines[$i]->detail_batch) ? $object->lines[$i]->detail_batch : false);
|
||||
|
||||
if ($idprod) {
|
||||
// If a predefined product and multilang and on other lang, we renamed label with label translated
|
||||
if (getDolGlobalInt('MAIN_MULTILANGS') && ($outputlangs->defaultlang != $langs->defaultlang)) {
|
||||
if ($multilangsactive && ($outputlangs->defaultlang != $langs->defaultlang)) {
|
||||
$translatealsoifmodified = (!empty($conf->global->MAIN_MULTILANG_TRANSLATE_EVEN_IF_MODIFIED)); // By default if value was modified manually, we keep it (no translation because we don't have it)
|
||||
|
||||
// TODO Instead of making a compare to see if param was modified, check that content contains reference translation. If yes, add the added part to the new translation
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||
$desc = dol_htmlentitiesbr($text, 1);
|
||||
//print $outputlangs->convToOutputCharset($desc); exit;
|
||||
|
||||
$pdf->writeHTMLCell(180, 3, 10, $tab_top + 5, $outputlangs->convToOutputCharset($desc), 0, 1);
|
||||
$pdf->writeHTMLCell(180, 3, $this->posxdesc - 1, $tab_top + 5, $outputlangs->convToOutputCharset($desc), 0, 1);
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
$pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY);
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ class modStock extends DolibarrModules
|
|||
);
|
||||
$this->import_updatekeys_array[$r] = array('ps.fk_product'=>'Product', 'ps.fk_entrepot'=>"Warehouse");
|
||||
$this->import_run_sql_after_array[$r] = array( // Because we may change data that are denormalized, we must update dernormalized data after.
|
||||
'UPDATE '.MAIN_DB_PREFIX.'product as p SET p.stock = (SELECT SUM(ps.reel) FROM '.MAIN_DB_PREFIX.'product_stock ps WHERE ps.fk_product = p.rowid);'
|
||||
'UPDATE '.MAIN_DB_PREFIX.'product as p SET stock = (SELECT SUM(ps.reel) FROM '.MAIN_DB_PREFIX.'product_stock ps WHERE ps.fk_product = p.rowid);'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -469,6 +469,14 @@ class doc_generic_task_odt extends ModelePDFTask
|
|||
return -1;
|
||||
}
|
||||
|
||||
// Add odtgeneration hook
|
||||
if (!is_object($hookmanager)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager = new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('odtgeneration'));
|
||||
global $action;
|
||||
|
||||
if (!is_object($outputlangs)) {
|
||||
$outputlangs = $langs;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,6 +216,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||
$hookmanager = new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('odtgeneration'));
|
||||
global $action;
|
||||
|
||||
if (!is_object($outputlangs)) {
|
||||
$outputlangs = $langs;
|
||||
|
|
|
|||
|
|
@ -77,44 +77,18 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||
if ($res > 0) {
|
||||
// Send email to notification email
|
||||
if (empty($conf->global->TICKET_DISABLE_ALL_MAILS)) {
|
||||
// Init to avoid errors
|
||||
$filepath = array();
|
||||
$filename = array();
|
||||
$mimetype = array();
|
||||
|
||||
// Send email to assigned user
|
||||
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketAssignedToYou');
|
||||
$message = '<p>'.$langs->transnoentities('TicketAssignedEmailBody', $object->track_id, dolGetFirstLastname($user->firstname, $user->lastname))."</p>";
|
||||
$message .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
|
||||
$message .= '<li>'.$langs->trans('Type').' : '.$object->type_label.'</li>';
|
||||
$message .= '<li>'.$langs->trans('Category').' : '.$object->category_label.'</li>';
|
||||
$message .= '<li>'.$langs->trans('Severity').' : '.$object->severity_label.'</li>';
|
||||
// Extrafields
|
||||
if (is_array($object->array_options) && count($object->array_options) > 0) {
|
||||
foreach ($object->array_options as $key => $value) {
|
||||
$message .= '<li>'.$langs->trans($key).' : '.$value.'</li>';
|
||||
}
|
||||
}
|
||||
|
||||
$message .= '</ul>';
|
||||
$message .= '<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
|
||||
$message .= '<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
|
||||
|
||||
$sendto = $userstat->email;
|
||||
$from = dolGetFirstLastname($user->firstname, $user->lastname).'<'.$user->email.'>';
|
||||
|
||||
$message = dol_nl2br($message);
|
||||
$subject_assignee = 'TicketAssignedToYou';
|
||||
$body_assignee = 'TicketAssignedEmailBody';
|
||||
$see_ticket_assignee = 'SeeThisTicketIntomanagementInterface';
|
||||
|
||||
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1);
|
||||
if ($mailfile->error) {
|
||||
setEventMessages($mailfile->error, $mailfile->errors, 'errors');
|
||||
} else {
|
||||
$result = $mailfile->sendfile();
|
||||
if (!empty($sendto)) {
|
||||
$this->composeAndSendAssigneeMessage($sendto, $subject_assignee, $body_assignee, $see_ticket_assignee, $object, $langs);
|
||||
}
|
||||
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
|
|
@ -173,10 +147,15 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||
|
||||
$subject_admin = 'TicketNewEmailSubjectAdmin';
|
||||
$body_admin = 'TicketNewEmailBodyAdmin';
|
||||
|
||||
$subject_customer = 'TicketNewEmailSubjectCustomer';
|
||||
$body_customer = 'TicketNewEmailBodyCustomer';
|
||||
$see_ticket_customer = 'TicketNewEmailBodyInfosTrackUrlCustomer';
|
||||
|
||||
$subject_assignee = 'TicketAssignedToYou';
|
||||
$body_assignee = 'TicketAssignedEmailBody';
|
||||
$see_ticket_assignee = 'SeeThisTicketIntomanagementInterface';
|
||||
|
||||
// Send email to notification email
|
||||
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) && empty($object->context['disableticketemail'])) {
|
||||
$sendto = empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? '' : $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
||||
|
|
@ -185,6 +164,34 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||
}
|
||||
}
|
||||
|
||||
// Send email to assignee if an assignee was set at creation
|
||||
if ($object->fk_user_assign > 0 && $object->fk_user_assign != $user->id && empty($object->context['disableticketemail'])) {
|
||||
$userstat = new User($this->db);
|
||||
$res = $userstat->fetch($object->fk_user_assign);
|
||||
if ($res > 0) {
|
||||
// Send email to notification email
|
||||
if (!getDolGlobalString('TICKET_DISABLE_ALL_MAILS')) {
|
||||
// Send email to assigned user
|
||||
$sendto = $userstat->email;
|
||||
if (!getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
|
||||
if (!empty($sendto)) {
|
||||
$this->composeAndSendAssigneeMessage($sendto, $subject_assignee, $body_assignee, $see_ticket_assignee, $object, $langs);
|
||||
}
|
||||
|
||||
if (!getDolUserString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->error = $userstat->error;
|
||||
$this->errors = $userstat->errors;
|
||||
}
|
||||
}
|
||||
|
||||
// Send email to customer
|
||||
if (empty($conf->global->TICKET_DISABLE_CUSTOMER_MAILS) && empty($object->context['disableticketemail']) && $object->notify_tiers_at_create) {
|
||||
$sendto = '';
|
||||
|
|
@ -428,9 +435,9 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||
|
||||
$trackid = 'tic'.$object->id;
|
||||
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('MAIN_MAIL_AUTOCOPY_TO');
|
||||
|
||||
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = null;
|
||||
if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('MAIN_MAIL_AUTOCOPY_TO');
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
|
||||
|
|
@ -451,4 +458,72 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Composes and sends a message concerning a ticket, to be sent to user assigned to the ticket
|
||||
*
|
||||
* @param string $sendto Addresses to send the mail, format "first@address.net, second@address.net, " etc.
|
||||
* @param string $base_subject email subject. Non-translated string.
|
||||
* @param string $body email body (first line). Non-translated string.
|
||||
* @param string $see_ticket string indicating the ticket public address
|
||||
* @param Ticket $object the ticket thet the email refers to
|
||||
* @param Translate $langs the translation object
|
||||
* @return void
|
||||
*/
|
||||
private function composeAndSendAssigneeMessage($sendto, $base_subject, $body, $see_ticket, Ticket $object, Translate $langs)
|
||||
{
|
||||
global $conf, $user, $mysoc;
|
||||
|
||||
// Init to avoid errors
|
||||
$filepath = array();
|
||||
$filename = array();
|
||||
$mimetype = array();
|
||||
|
||||
// Send email to assigned user
|
||||
$appli = $mysoc->name;
|
||||
|
||||
$subject = '['.$appli.'] '.$langs->transnoentities($base_subject);
|
||||
$message = '<p>'.$langs->transnoentities($body, $object->track_id, dolGetFirstLastname($user->firstname, $user->lastname))."</p>";
|
||||
$message .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
|
||||
$message .= '<li>'.$langs->trans('Type').' : '.$object->type_label.'</li>';
|
||||
$message .= '<li>'.$langs->trans('Category').' : '.$object->category_label.'</li>';
|
||||
$message .= '<li>'.$langs->trans('Severity').' : '.$object->severity_label.'</li>';
|
||||
// Extrafields
|
||||
if (is_array($object->array_options) && count($object->array_options) > 0) {
|
||||
foreach ($object->array_options as $key => $value) {
|
||||
$message .= '<li>'.$langs->trans($key).' : '.$value.'</li>';
|
||||
}
|
||||
}
|
||||
|
||||
$message .= '</ul>';
|
||||
$message .= '<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
|
||||
$message .= '<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans($see_ticket).'</a></p>';
|
||||
|
||||
$from = dolGetFirstLastname($user->firstname, $user->lastname).'<'.$user->email.'>';
|
||||
|
||||
$message = dol_nl2br($message);
|
||||
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = null;
|
||||
if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('MAIN_MAIL_AUTOCOPY_TO');
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1);
|
||||
if ($mailfile->error) {
|
||||
setEventMessages($mailfile->error, $mailfile->errors, 'errors');
|
||||
} else {
|
||||
$result = $mailfile->sendfile();
|
||||
if ($result) {
|
||||
// update last_msg_sent date
|
||||
$object->fetch($object->id);
|
||||
$object->date_last_msg_sent = dol_now();
|
||||
$object->update($user);
|
||||
}
|
||||
}
|
||||
if (!getDolUserString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,6 +231,12 @@ class Donations extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->don->array_options[$index] = $this->_checkValForAPI($field, $val, $this->don);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->don->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -447,6 +447,12 @@ class Shipments extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->shipment->array_options[$index] = $this->_checkValForAPI($field, $val, $this->shipment);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->shipment->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -420,6 +420,12 @@ class ExpenseReports extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->expensereport->array_options[$index] = $this->_checkValForAPI($field, $val, $this->expensereport);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->expensereport->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -619,6 +619,7 @@ class ExpenseReport extends CommonObject
|
|||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as d";
|
||||
if ($ref) {
|
||||
$sql .= " WHERE d.ref = '".$this->db->escape($ref)."'";
|
||||
$sql .= " AND d.entity IN (".getEntity('expensereport').")";
|
||||
} else {
|
||||
$sql .= " WHERE d.rowid = ".((int) $id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -263,10 +263,16 @@ class SupplierInvoices extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->invoice->array_options[$index] = $this->_checkValForAPI($field, $val, $this->invoice);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->invoice->$field = $value;
|
||||
}
|
||||
|
||||
if ($this->invoice->update($id, DolibarrApiAccess::$user)) {
|
||||
if ($this->invoice->update(DolibarrApiAccess::$user)) {
|
||||
return $this->get($id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -288,6 +288,12 @@ class SupplierOrders extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->order->array_options[$index] = $this->_checkValForAPI($field, $val, $this->order);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->order->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2312,6 +2312,16 @@ class CommandeFournisseur extends CommonOrder
|
|||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$sql1 = "UPDATE ".$this->db->prefix()."commandedet SET fk_commandefourndet = NULL WHERE fk_commandefourndet IN (SELECT rowid FROM ".$main." WHERE fk_commande = ".((int) $this->id).")";
|
||||
dol_syslog(__METHOD__." linked order lines", LOG_DEBUG);
|
||||
if (!$this->db->query($sql1)) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseurdet WHERE fk_commande =".((int) $this->id);
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
if (!$this->db->query($sql)) {
|
||||
|
|
@ -4137,7 +4147,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||
return -1;
|
||||
}
|
||||
|
||||
$sql1 = 'UPDATE '.MAIN_DB_PREFIX."commandedet SET fk_commandefourndet = NULL WHERE fk_commandefourndet=".((int) $this->id);
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."commandedet SET fk_commandefourndet = NULL WHERE fk_commandefourndet=".((int) $this->id);
|
||||
$resql = $this->db->query($sql1);
|
||||
if (!$resql) {
|
||||
$this->db->rollback();
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ if (!$sortorder) {
|
|||
$sortorder = "ASC";
|
||||
}
|
||||
if (!$sortfield) {
|
||||
$sortfield = "p.name";
|
||||
$sortfield = "p.lastname";
|
||||
}
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
|
||||
|
|
@ -85,12 +85,12 @@ if (dol_strlen($stcomm)) {
|
|||
}
|
||||
|
||||
if (dol_strlen($begin)) {
|
||||
$sql .= " AND p.name LIKE '$begin%'";
|
||||
$sql .= " AND p.lastname LIKE '$begin%'";
|
||||
}
|
||||
|
||||
if ($contactname) {
|
||||
$sql .= " AND p.name LIKE '%".strtolower($contactname)."%'";
|
||||
$sortfield = "p.name";
|
||||
$sql .= " AND p.lastname LIKE '%".strtolower($contactname)."%'";
|
||||
$sortfield = "p.lastname";
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ if ($result) {
|
|||
|
||||
print '<table class="liste centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.name", $begin, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.lastname", $begin, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Firstname", $_SERVER["PHP_SELF"], "p.firstname", $begin, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", $begin, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Email");
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ class Odf
|
|||
public $userdefined=array();
|
||||
|
||||
const PIXEL_TO_CM = 0.026458333;
|
||||
const FIND_TAGS_REGEX = '/<([A-Za-z0-9]+)(?:\s([A-Za-z]+(?:\-[A-Za-z]+)?(?:=(?:".*?")|(?:[0-9]+))))*(?:(?:\s\/>)|(?:>(.*)<\/\1>))/s';
|
||||
const FIND_ENCODED_TAGS_REGEX = '/<([A-Za-z]+)(?:\s([A-Za-z]+(?:\-[A-Za-z]+)?(?:=(?:".*?")|(?:[0-9]+))))*(?:(?:\s\/>)|(?:>(.*)<\/\1>))/';
|
||||
const FIND_TAGS_REGEX = '/<([A-Za-z0-9]+)(?:\s([A-Za-z]+(?:\-[A-Za-z]+)?(?:=(?:".*?")|(?:[0-9]+))))*(?:(?:\s\/>)|(?:>(((?!<\1(\s.*)?>).)*)<\/\1>))/s';
|
||||
const FIND_ENCODED_TAGS_REGEX = '/<([A-Za-z]+)(?:\s([A-Za-z]+(?:\-[A-Za-z]+)?(?:=(?:".*?")|(?:[0-9]+))))*(?:(?:\s\/>)|(?:>(((?!<\1(\s.*)?>).)*)<\/\1>))/';
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -1017,4 +1017,4 @@ IMG;
|
|||
$this->contentXml = preg_replace($searchreg, "", $this->contentXml);
|
||||
return $matches[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -878,7 +878,7 @@ class PDF417 {
|
|||
$txtarr = array(); // array of characters and sub-mode switching characters
|
||||
$codelen = strlen($code);
|
||||
for ($i = 0; $i < $codelen; ++$i) {
|
||||
$chval = ord($code{$i});
|
||||
$chval = ord($code[$i]);
|
||||
if (($k = array_search($chval, $this->textsubmodes[$submode])) !== false) {
|
||||
// we are on the same sub-mode
|
||||
$txtarr[] = $k;
|
||||
|
|
@ -888,7 +888,7 @@ class PDF417 {
|
|||
// search new sub-mode
|
||||
if (($s != $submode) AND (($k = array_search($chval, $this->textsubmodes[$s])) !== false)) {
|
||||
// $s is the new submode
|
||||
if (((($i + 1) == $codelen) OR ((($i + 1) < $codelen) AND (array_search(ord($code{($i + 1)}), $this->textsubmodes[$submode]) !== false))) AND (($s == 3) OR (($s == 0) AND ($submode == 1)))) {
|
||||
if (((($i + 1) == $codelen) OR ((($i + 1) < $codelen) AND (array_search(ord($code[($i + 1)]), $this->textsubmodes[$submode]) !== false))) AND (($s == 3) OR (($s == 0) AND ($submode == 1)))) {
|
||||
// shift (temporary change only for this char)
|
||||
if ($s == 3) {
|
||||
// shift to puntuaction
|
||||
|
|
@ -952,7 +952,7 @@ class PDF417 {
|
|||
$cw = array_merge($cw, $cw6);
|
||||
} else {
|
||||
for ($i = 0; $i < $sublen; ++$i) {
|
||||
$cw[] = ord($code{$i});
|
||||
$cw[] = ord($code[$i]);
|
||||
}
|
||||
}
|
||||
$code = $rest;
|
||||
|
|
|
|||
|
|
@ -298,6 +298,12 @@ class KnowledgeManagement extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->knowledgerecord->array_options[$index] = $this->_checkValForAPI($field, $val, $this->knowledgerecord);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->knowledgerecord->$field = $this->_checkValForAPI($field, $value, $this->knowledgerecord);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -410,6 +410,7 @@ InvoiceAutoValidate=Validate invoices automatically
|
|||
GeneratedFromRecurringInvoice=Generated from template recurring invoice %s
|
||||
DateIsNotEnough=Date not reached yet
|
||||
InvoiceGeneratedFromTemplate=Invoice %s generated from recurring template invoice %s
|
||||
InvoiceGeneratedFromTemplateError=Error Invoice %s generated from recurring template invoice %s : %s
|
||||
GeneratedFromTemplate=Generated from template invoice %s
|
||||
WarningInvoiceDateInFuture=Warning, the invoice date is higher than current date
|
||||
WarningInvoiceDateTooFarInFuture=Warning, the invoice date is too far from current date
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ if (empty($reshook)) {
|
|||
if ($result > 0) {
|
||||
setEventMessages($langs->trans('LoanPaid'), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($loan->error, null, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ if (empty($reshook)) {
|
|||
header("Location: list.php");
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($loan->error, null, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -308,6 +308,7 @@ class Loan extends CommonObject
|
|||
$accountline->fetch($line_url['fk_bank']);
|
||||
$result = $accountline->delete_urls($user);
|
||||
if ($result < 0) {
|
||||
$this->errors = array_merge($this->errors, [$accountline->error], $accountline->errors);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2014-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015-2018 Frederic France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||
/* Copyright (C) 2014-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2015-2018 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -99,6 +99,11 @@ class PaymentLoan extends CommonObject
|
|||
public $type_code;
|
||||
public $type_label;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $bank_line;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
|
@ -380,19 +385,17 @@ class PaymentLoan extends CommonObject
|
|||
*/
|
||||
public function delete($user, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url";
|
||||
$sql .= " WHERE type='payment_loan' AND url_id=".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
||||
if ($this->bank_line > 0) {
|
||||
$accline = new AccountLine($this->db);
|
||||
$accline->fetch($this->bank_line);
|
||||
$result = $accline->delete($user);
|
||||
if ($result < 0) {
|
||||
$this->errors[] = $accline->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -422,22 +425,6 @@ class PaymentLoan extends CommonObject
|
|||
}
|
||||
}
|
||||
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
// }
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error) {
|
||||
foreach ($this->errors as $errmsg) {
|
||||
|
|
|
|||
|
|
@ -257,6 +257,12 @@ class MyModuleApi extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->myobject->array_options[$index] = $this->_checkValForAPI($field, $val, $this->myobject);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->myobject->$field = $this->_checkValForAPI($field, $value, $this->myobject);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -233,7 +233,12 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
|
|||
}
|
||||
|
||||
// Add odtgeneration hook
|
||||
if (!is_object($hookmanager)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager = new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('odtgeneration'));
|
||||
global $action;
|
||||
|
||||
if (!is_object($outputlangs)) {
|
||||
$outputlangs = $langs;
|
||||
|
|
|
|||
|
|
@ -238,6 +238,12 @@ class Mos extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->mo->array_options[$index] = $this->_checkValForAPI($field, $val, $this->mo);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->mo->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -255,6 +255,12 @@ class PartnershipApi extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->partnership->array_options[$index] = $this->_checkValForAPI($field, $val, $this->partnership);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->partnership->$field = $this->_checkValForAPI($field, $value, $this->partnership);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -361,6 +361,12 @@ class Products extends DolibarrApi
|
|||
if ($field == 'stock_reel') {
|
||||
throw new RestException(400, 'Stock reel cannot be updated here. Use the /stockmovements endpoint instead');
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->product->array_options[$index] = $this->_checkValForAPI($field, $val, $this->product);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->product->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5016,7 +5016,8 @@ class Product extends CommonObject
|
|||
//$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty'],2=>$rec['fk_product_type']);
|
||||
//$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']);
|
||||
if (empty($firstlevelonly)) {
|
||||
$listofchilds = $this->getChildsArbo($rec['rowid'], 0, $level + 1, array_push($parents, $rec['rowid']));
|
||||
$parents[] = $rec['rowid'];
|
||||
$listofchilds = $this->getChildsArbo($rec['rowid'], 0, $level + 1, $parents);
|
||||
foreach ($listofchilds as $keyChild => $valueChild) {
|
||||
$prods[$rec['rowid']]['childs'][$keyChild] = $valueChild;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -206,6 +206,12 @@ class Warehouses extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->warehouse->array_options[$index] = $this->_checkValForAPI($field, $val, $this->warehouse);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->warehouse->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -461,6 +461,12 @@ class Projects extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->project->array_options[$index] = $this->_checkValForAPI($field, $val, $this->project);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->project->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -461,6 +461,12 @@ class Tasks extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->task->array_options[$index] = $this->_checkValForAPI($field, $val, $this->task);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->task->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,10 @@ if ($reshook < 0) {
|
|||
}
|
||||
|
||||
if ($id > 0 || $ref) {
|
||||
$object->fetch($id, $ref);
|
||||
$ret = $object->fetch($id, $ref);
|
||||
if ($ret > 0) {
|
||||
$projectstatic->fetch($object->fk_project);
|
||||
}
|
||||
}
|
||||
|
||||
// Security check
|
||||
|
|
@ -204,14 +207,14 @@ if ($action == 'remove_file' && $user->rights->projet->creer) {
|
|||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->project->dir_output;
|
||||
$upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
|
||||
$file = $upload_dir.'/'.dol_sanitizeFileName(GETPOST('file'));
|
||||
|
||||
$ret = dol_delete_file($file);
|
||||
if ($ret) {
|
||||
setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||
setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -222,7 +225,6 @@ if ($action == 'remove_file' && $user->rights->projet->creer) {
|
|||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
$formfile = new FormFile($db);
|
||||
$result = $projectstatic->fetch($object->fk_project);
|
||||
|
||||
$title = $object->ref;
|
||||
if (!empty($withproject)) {
|
||||
|
|
@ -692,7 +694,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
/*
|
||||
* Generated documents
|
||||
*/
|
||||
$filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
|
||||
$filename = '';
|
||||
$filedir = $conf->project->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
|
||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
$genallowed = ($user->rights->projet->lire);
|
||||
|
|
|
|||
|
|
@ -448,6 +448,12 @@ class Receptions extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->reception->array_options[$index] = $this->_checkValForAPI($field, $val, $this->reception);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->reception->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -221,7 +221,12 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi
|
|||
}
|
||||
|
||||
// Add odtgeneration hook
|
||||
if (!is_object($hookmanager)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager = new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('odtgeneration'));
|
||||
global $action;
|
||||
|
||||
if (!is_object($outputlangs)) {
|
||||
$outputlangs = $langs;
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ class Contacts extends DolibarrApi
|
|||
continue;
|
||||
} elseif ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->contact->array_options[$index] = $val;
|
||||
$this->contact->array_options[$index] = $this->_checkValForAPI($field, $val, $this->contact);
|
||||
}
|
||||
} else {
|
||||
$this->contact->$field = $value;
|
||||
|
|
|
|||
|
|
@ -302,6 +302,12 @@ class Thirdparties extends DolibarrApi
|
|||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->company->array_options[$index] = $this->_checkValForAPI($field, $val, $this->company);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->company->$field = $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -516,7 +516,7 @@ if ($search_sale == -2) {
|
|||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid";
|
||||
//elseif ($search_sale || (empty($user->rights->societe->client->voir) && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->societe->client->readallthirdparties_advance)) && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
} elseif (!empty($search_sale) && $search_sale != '-1' || (empty($user->rights->societe->client->voir) && !$socid)) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux AS sc ON s.rowid = sc.fk_soc";
|
||||
}
|
||||
// Add table from hooks
|
||||
$parameters = array();
|
||||
|
|
@ -527,9 +527,6 @@ $sql .= " WHERE s.entity IN (".getEntity('societe').")";
|
|||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($search_sale && $search_sale != '-1' && $search_sale != '-2') {
|
||||
$sql .= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
}
|
||||
if (empty($user->rights->fournisseur->lire)) {
|
||||
$sql .= " AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible
|
||||
}
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@ if (empty($reshook)) {
|
|||
// Action to add a message (private or not, with email or not).
|
||||
// This may also send an email (concatenated with email_intro and email footer if checkbox was selected)
|
||||
if ($action == 'add_message' && GETPOSTISSET('btn_add_message') && $permissiontoread) {
|
||||
$ret = $object->newMessage($user, $action, (GETPOST('private_message', 'alpha') == "on" ? 1 : 0), 0);
|
||||
$ret = $object->newMessage($user, $action, GETPOSTINT('private_message'), 0);
|
||||
|
||||
if ($ret > 0) {
|
||||
if (!empty($backtopage)) {
|
||||
|
|
|
|||
|
|
@ -377,10 +377,19 @@ class Tickets extends DolibarrApi
|
|||
}
|
||||
|
||||
foreach ($request_data as $field => $value) {
|
||||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->ticket->array_options[$index] = $this->_checkValForAPI($field, $val, $this->ticket);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->ticket->$field = $value;
|
||||
}
|
||||
|
||||
if ($this->ticket->update($id, DolibarrApiAccess::$user)) {
|
||||
if ($this->ticket->update(DolibarrApiAccess::$user)) {
|
||||
return $this->get($id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -406,6 +406,12 @@ class Users extends DolibarrApi
|
|||
throw new RestException(500, 'Error when updating status of user: '.$this->useraccount->error);
|
||||
}
|
||||
} else {
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->useraccount->array_options[$index] = $this->_checkValForAPI($field, $val, $this->useraccount);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->useraccount->$field = $value;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -702,16 +702,16 @@ class ProductCombination
|
|||
* [...]
|
||||
* )
|
||||
*
|
||||
* @param User $user Object user
|
||||
* @param Product $product Parent product
|
||||
* @param array $combinations Attribute and value combinations.
|
||||
* @param array $variations Price and weight variations
|
||||
* @param bool|array $price_var_percent Is the price variation a relative variation?
|
||||
* @param bool|float $forced_pricevar If the price variation is forced
|
||||
* @param bool|float $forced_weightvar If the weight variation is forced
|
||||
* @param bool|string $forced_refvar If the reference is forced
|
||||
* @param string $ref_ext External reference
|
||||
* @return int <0 KO, >0 OK
|
||||
* @param User $user Object user
|
||||
* @param Product $product Parent product
|
||||
* @param array $combinations Attribute and value combinations.
|
||||
* @param array $variations Price and weight variations
|
||||
* @param bool|array $price_var_percent Is the price variation a relative variation?
|
||||
* @param bool|float|array $forced_pricevar If the price variation is forced
|
||||
* @param bool|float $forced_weightvar If the weight variation is forced
|
||||
* @param bool|string $forced_refvar If the reference is forced
|
||||
* @param string $ref_ext External reference
|
||||
* @return int <0 KO, >0 OK
|
||||
*/
|
||||
public function createProductCombination(User $user, Product $product, array $combinations, array $variations, $price_var_percent = false, $forced_pricevar = false, $forced_weightvar = false, $forced_refvar = false, $ref_ext = '')
|
||||
{
|
||||
|
|
@ -752,8 +752,8 @@ class ProductCombination
|
|||
$price_impact = $forced_pricevar;
|
||||
}
|
||||
|
||||
if (!array($price_var_percent)) {
|
||||
$price_var_percent[1] = (float) $price_var_percent;
|
||||
if (!is_array($price_var_percent)) {
|
||||
$price_var_percent = array(1 => (bool) $price_var_percent);
|
||||
}
|
||||
|
||||
$newcomb = new ProductCombination($this->db);
|
||||
|
|
@ -840,12 +840,7 @@ class ProductCombination
|
|||
$productCombinationLevel->fk_product_attribute_combination = $newcomb->id;
|
||||
$productCombinationLevel->fk_price_level = $i;
|
||||
$productCombinationLevel->variation_price = $price_impact[$i];
|
||||
|
||||
if (is_array($price_var_percent)) {
|
||||
$productCombinationLevel->variation_price_percentage = (empty($price_var_percent[$i]) ? false : $price_var_percent[$i]);
|
||||
} else {
|
||||
$productCombinationLevel->variation_price_percentage = $price_var_percent;
|
||||
}
|
||||
$productCombinationLevel->variation_price_percentage = $price_var_percent[$i];
|
||||
|
||||
$newcomb->combination_price_levels[$i] = $productCombinationLevel;
|
||||
}
|
||||
|
|
@ -955,13 +950,26 @@ class ProductCombination
|
|||
$variations[$tmp_pc2v->fk_prod_attr] = $tmp_pc2v->fk_prod_attr_val;
|
||||
}
|
||||
|
||||
$variation_price_percentage = $combination->variation_price_percentage;
|
||||
$variation_price = $combination->variation_price;
|
||||
|
||||
if (getDolGlobalInt('PRODUIT_MULTIPRICES') && getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT') > 1) {
|
||||
$variation_price_percentage = [ ];
|
||||
$variation_price = [ ];
|
||||
|
||||
foreach ($combination->combination_price_levels as $productCombinationLevel) {
|
||||
$variation_price_percentage[$productCombinationLevel->fk_price_level] = $productCombinationLevel->variation_price_percentage;
|
||||
$variation_price[$productCombinationLevel->fk_price_level] = $productCombinationLevel->variation_price;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->createProductCombination(
|
||||
$user,
|
||||
$destProduct,
|
||||
$variations,
|
||||
array(),
|
||||
$combination->variation_price_percentage,
|
||||
$combination->variation_price,
|
||||
$variation_price_percentage,
|
||||
$variation_price,
|
||||
$combination->variation_weight
|
||||
) < 0) {
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ class Zapier extends DolibarrApi
|
|||
$this->hook->$field = $value;
|
||||
}
|
||||
|
||||
if ($this->hook->update($id, DolibarrApiAccess::$user) > 0) {
|
||||
if ($this->hook->update(DolibarrApiAccess::$user) > 0) {
|
||||
return $this->get($id);
|
||||
} else {
|
||||
throw new RestException(500, $this->hook->error);
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ if (is_array($object->lines) && (count($object->lines) > 0)) {
|
|||
exit(-1);
|
||||
}
|
||||
}
|
||||
$user->getrights();
|
||||
$user->getrights('', 1); // We force rights reload to have the correct permissions for user in the entity we just switched in
|
||||
}
|
||||
|
||||
// Reload langs
|
||||
|
|
|
|||
|
|
@ -296,33 +296,45 @@ class ODFTest extends PHPUnit\Framework\TestCase
|
|||
'charset' => null,
|
||||
'expected' => utf8_encode('text with <text:span text:style-name="boldText">intricated<text:span text:style-name="underlineText">tags</text:span></text:span>'),
|
||||
],
|
||||
24 => [
|
||||
'to_convert' => "text with <strong>two</strong> (strong) <strong>tags</strong>",
|
||||
'encode' => true,
|
||||
'charset' => null,
|
||||
'expected' => utf8_encode('text with <text:span text:style-name="boldText">two</text:span> (strong) <text:span text:style-name="boldText">tags</text:span>'),
|
||||
],
|
||||
25 => [
|
||||
'to_convert' => "text with <strong class=\"whatever\">two</strong> (strong) <strong class=\"the weather\">tags and <u>intricated</u> underline </strong>",
|
||||
'encode' => true,
|
||||
'charset' => null,
|
||||
'expected' => utf8_encode('text with <text:span text:style-name="boldText">two</text:span> (strong) <text:span text:style-name="boldText">tags and <text:span text:style-name="underlineText">intricated</text:span> underline </text:span>'),
|
||||
],
|
||||
|
||||
// One can also pass html-encoded string to the method
|
||||
24 => [
|
||||
26 => [
|
||||
'to_convert' => 'One&two',
|
||||
'encode' => true,
|
||||
'charset' => null,
|
||||
'expected' => 'One&two',
|
||||
],
|
||||
25 => [
|
||||
27 => [
|
||||
'to_convert' => "text with <strong>strong, </strong><em>emphasis</em> and <u>underlined</u> words with <i>it@lic sp&ciàlchärs éè l'</i>",
|
||||
'encode' => false,
|
||||
'charset' => 'UTF-8',
|
||||
'expected' => 'text with <text:span text:style-name="boldText">strong, </text:span><text:span text:style-name="italicText">emphasis</text:span> and <text:span text:style-name="underlineText">underlined</text:span> words with <text:span text:style-name="italicText">it@lic sp&ciàlchärs éè l\'</text:span>',
|
||||
],
|
||||
26 => [
|
||||
28 => [
|
||||
'to_convert' => "text with <strong>strong, </strong><em>emphasis</em> and <u>underlined</u> words with <i>it@lic sp&ciàlchärs éè l'</i>",
|
||||
'encode' => true,
|
||||
'charset' => 'UTF-8',
|
||||
'expected' => 'text with <text:span text:style-name="boldText">strong, </text:span><text:span text:style-name="italicText">emphasis</text:span> and <text:span text:style-name="underlineText">underlined</text:span> words with <text:span text:style-name="italicText">it@lic sp&ciàlchärs éè l'</text:span>',
|
||||
],
|
||||
27 => [
|
||||
29 => [
|
||||
'to_convert' => "text with <strong>strong, </strong><em>emphasis</em> and <u>underlined</u> words with <i>it@lic sp&ciàlchärs éè l'</i>",
|
||||
'encode' => false,
|
||||
'charset' => null,
|
||||
'expected' => utf8_encode('text with <text:span text:style-name="boldText">strong, </text:span><text:span text:style-name="italicText">emphasis</text:span> and <text:span text:style-name="underlineText">underlined</text:span> words with <text:span text:style-name="italicText">it@lic sp&ciàlchärs éè l\'</text:span>'),
|
||||
],
|
||||
28 => [
|
||||
30 => [
|
||||
'to_convert' => "text with <strong>strong, </strong><em>emphasis</em> and <u>underlined</u> words with <i>it@lic sp&ciàlchärs éè l'</i>",
|
||||
'encode' => true,
|
||||
'charset' => null,
|
||||
|
|
@ -341,20 +353,20 @@ class ODFTest extends PHPUnit\Framework\TestCase
|
|||
// Following tests reflect the current behavior. They may evolve if the method behavior changes.
|
||||
|
||||
// The method removes hyperlinks and tags that are not dealt with.
|
||||
29 => [
|
||||
31 => [
|
||||
'to_convert' => '123 <a href="/test.php">trucmachin > truc < troc > trac</a>bla bla',
|
||||
'encode' => true,
|
||||
'charset' => null,
|
||||
'expected' => "123 trucmachin > truc < troc > tracbla bla",
|
||||
],
|
||||
30 => [
|
||||
32 => [
|
||||
'to_convert' => '123 <h3>Title</h3> bla',
|
||||
'encode' => true,
|
||||
'charset' => null,
|
||||
'expected' => "123 Title bla",
|
||||
],
|
||||
// HTML should not take \n into account, but only <br />.
|
||||
31 => [
|
||||
33 => [
|
||||
'to_convert' => "text with <strong>strong text </strong>, a line\nbreak and <u>underlined</u> words with <i>it@lic sp&ciàlchärs éè l'</i>",
|
||||
'encode' => false,
|
||||
'charset' => 'UTF-8',
|
||||
|
|
@ -371,7 +383,7 @@ class ODFTest extends PHPUnit\Framework\TestCase
|
|||
} else {
|
||||
$res = $odf->convertVarToOdf($case['to_convert'], $case['encode']);
|
||||
}
|
||||
$this->assertEquals($res, $case['expected']);
|
||||
$this->assertEquals($case['expected'], $res);
|
||||
}
|
||||
|
||||
print __METHOD__." result=".$result."\n";
|
||||
|
|
|
|||
Loading…
Reference in a new issue