Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
870ac42082
@ -1 +1 @@
|
||||
7
|
||||
10
|
||||
@ -524,12 +524,13 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/ansible`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codetemplates`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/dbmodel`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/examples/ldap`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/examples/zapier`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/initdata`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/initdemo`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/iso-normes`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/ldap`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/licence`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/resources/dbmodel`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/resources/iso-normes`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/resources/licence`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/mail`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/multitail`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/phpcheckstyle`;
|
||||
@ -894,7 +895,7 @@ if ($nboftargetok) {
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build`;
|
||||
|
||||
|
||||
print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp\n";
|
||||
$cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp\"";
|
||||
$ret=`$cmd`;
|
||||
|
||||
@ -1,15 +1,17 @@
|
||||
*~
|
||||
.#*
|
||||
.git
|
||||
.gitignore
|
||||
.scrutinizer.yml
|
||||
Thumbs.db
|
||||
build/exe
|
||||
build/html
|
||||
dev/dbmodel
|
||||
dev/fpdf
|
||||
dev/examples/zapier
|
||||
dev/initdemo
|
||||
dev/initdata
|
||||
dev/iso-normes
|
||||
dev/licence
|
||||
dev/load
|
||||
dev/resources/dbmodel
|
||||
dev/resources/iso-normes
|
||||
dev/resources/licence
|
||||
htdocs/conf/conf.php
|
||||
htdocs/conf/conf.php.mysql
|
||||
htdocs/conf/conf.php.old
|
||||
|
||||
@ -434,7 +434,7 @@ if ($result) {
|
||||
$tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id;
|
||||
|
||||
// This part of code is no more required. it is here to solve case where a link were missing (ith v14.0.0) and keep writing in accountancy complete.
|
||||
// Note: A better way to fix this is to delete payement of salary and recreate it, or to fix the bookkeeping table manually after.
|
||||
// Note: A better way to fix this is to delete payment of salary and recreate it, or to fix the bookkeeping table manually after.
|
||||
if (!empty($conf->global->ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USEr_ON_SALARY_BANK_PAYMENT)) {
|
||||
$tmpsalary = new Salary($db);
|
||||
$tmpsalary->fetch($paymentsalstatic->id);
|
||||
|
||||
@ -66,6 +66,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||
@ -108,6 +109,7 @@ if (empty($reshook)) {
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers
|
||||
$actioncode = '';
|
||||
$search_rowid = '';
|
||||
$search_agenda_label = '';
|
||||
}
|
||||
}
|
||||
@ -187,6 +189,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||
|
||||
@ -580,14 +580,14 @@ print '<br>';
|
||||
print '<strong>MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED</strong> = '.getDolGlobalString('MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED', '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>')."<br>";
|
||||
print '<br>';
|
||||
|
||||
print '<strong>MAIN_SECURITY_FORCECSP</strong> = '.getDolGlobalString('MAIN_SECURITY_FORCECSP', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' <span class="opacitymedium">('.$langs->trans("Example").": \"frame-ancestors 'self'; default-src *; img-src *; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';\")</span><br>";
|
||||
print '<strong>MAIN_SECURITY_FORCECSP</strong> = '.getDolGlobalString('MAIN_SECURITY_FORCECSP', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' <span class="opacitymedium">('.$langs->trans("Example").": \"frame-ancestors 'self'; default-src *; img-src * data:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';\")</span><br>";
|
||||
print '<br>';
|
||||
|
||||
print '<strong>MAIN_SECURITY_FORCERP</strong> = '.getDolGlobalString('MAIN_SECURITY_FORCERP', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' <span class="opacitymedium">('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or")." \"same-origin\" so browser doesn't send any referrer when going into another web site domain)</span><br>";
|
||||
print '<br>';
|
||||
|
||||
print '<strong>WEBSITE_MAIN_SECURITY_FORCECSP</strong> = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCECSP', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>');
|
||||
print ' <span class="opacitymedium">('.$langs->trans("Example").": \"frame-ancestors 'self'; default-src 'self' 'unsafe-inline'; style-src https://cdnjs.cloudflare.com https://fonts.googleapis.com 'unsafe-inline'; script-src https://cdn.transifex.com https://www.googletagmanager.com 'unsafe-inline'; object-src https://youtube.com; frame-src https://youtube.com; img-src *;\")</span><br>";
|
||||
print ' <span class="opacitymedium">('.$langs->trans("Example").": \"frame-ancestors 'self'; default-src 'self' 'unsafe-inline'; style-src https://cdnjs.cloudflare.com https://fonts.googleapis.com 'unsafe-inline'; script-src https://cdn.transifex.com https://www.googletagmanager.com 'unsafe-inline'; object-src https://youtube.com; frame-src https://youtube.com; img-src * data:;\")</span><br>";
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 SuperAdmin <test@dolibarr.com>
|
||||
*
|
||||
* 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
|
||||
@ -23,39 +22,7 @@
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
$res = 0;
|
||||
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
||||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--; $j--;
|
||||
}
|
||||
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
|
||||
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
|
||||
}
|
||||
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
|
||||
$res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php using relative path
|
||||
if (!$res && file_exists("../main.inc.php")) {
|
||||
$res = @include "../main.inc.php";
|
||||
}
|
||||
if (!$res && file_exists("../../main.inc.php")) {
|
||||
$res = @include "../../main.inc.php";
|
||||
}
|
||||
if (!$res && file_exists("../../../main.inc.php")) {
|
||||
$res = @include "../../../main.inc.php";
|
||||
}
|
||||
if (!$res) {
|
||||
die("Include of main fails");
|
||||
}
|
||||
|
||||
global $langs, $user;
|
||||
|
||||
// Libraries
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
|
||||
require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook.lib.php';
|
||||
|
||||
@ -80,65 +47,27 @@ $label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scan_dir', 'alpha');
|
||||
$type = 'myobject';
|
||||
|
||||
$arrayofparameters = array(
|
||||
'WEBHOOK_MYPARAM1'=>array('type'=>'string', 'css'=>'minwidth500' ,'enabled'=>0),
|
||||
//'WEBHOOK_MYPARAM2'=>array('type'=>'textarea','enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM3'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM4'=>array('type'=>'emailtemplate:thirdparty', 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM5'=>array('type'=>'yesno', 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM5'=>array('type'=>'thirdparty_type', 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM6'=>array('type'=>'securekey', 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM7'=>array('type'=>'product', 'enabled'=>1),
|
||||
);
|
||||
|
||||
$error = 0;
|
||||
$setupnotempty = 0;
|
||||
|
||||
// Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only
|
||||
$useFormSetup = 0;
|
||||
// Convert arrayofparameter into a formSetup object
|
||||
if ($useFormSetup && (float) DOL_VERSION >= 15) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
|
||||
$formSetup = new FormSetup($db);
|
||||
$useFormSetup = 1;
|
||||
|
||||
// you can use the param convertor
|
||||
$formSetup->addItemsFromParamsArray($arrayofparameters);
|
||||
|
||||
// or use the new system see exemple as follow (or use both because you can ;-) )
|
||||
|
||||
/*
|
||||
// Hôte
|
||||
$item = $formSetup->newItem('NO_PARAM_JUST_TEXT');
|
||||
$item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'];
|
||||
$item->cssClass = 'minwidth500';
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM1 as a simple string input
|
||||
$item = $formSetup->newItem('WEBHOOK_MYPARAM1');
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM1 as a simple textarea input but we replace the text of field title
|
||||
$item = $formSetup->newItem('WEBHOOK_MYPARAM2');
|
||||
$item->nameText = $item->getNameText().' more html text ';
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM3
|
||||
$item = $formSetup->newItem('WEBHOOK_MYPARAM3');
|
||||
$item->setAsThirdpartyType();
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM4 : exemple of quick define write style
|
||||
$formSetup->newItem('WEBHOOK_MYPARAM4')->setAsYesNo();
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM5
|
||||
$formSetup->newItem('WEBHOOK_MYPARAM5')->setAsEmailTemplate('thirdparty');
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM6
|
||||
$formSetup->newItem('WEBHOOK_MYPARAM6')->setAsSecureKey()->enabled = 0; // disabled
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM7
|
||||
$formSetup->newItem('WEBHOOK_MYPARAM7')->setAsProduct();
|
||||
*/
|
||||
|
||||
$setupnotempty = count($formSetup->items);
|
||||
if (!class_exists('FormSetup')) {
|
||||
// For retrocompatibility Dolibarr < 16.0
|
||||
if (floatval(DOL_VERSION) < 16.0 && !class_exists('FormSetup')) {
|
||||
require_once __DIR__.'/../backport/v16/core/class/html.formsetup.class.php';
|
||||
} else {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
|
||||
}
|
||||
}
|
||||
|
||||
$formSetup = new FormSetup($db);
|
||||
|
||||
|
||||
$setupnotempty = count($formSetup->items);
|
||||
|
||||
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
@ -179,7 +108,7 @@ if ($action == 'updateMask') {
|
||||
$file = dol_buildpath($reldir."core/modules/webhook/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
$classname = "pdf_".$modele."_".strtolower($tmpobjectkey);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -190,7 +119,7 @@ if ($action == 'updateMask') {
|
||||
$module = new $classname($db);
|
||||
|
||||
if ($module->write_file($tmpobject, $langs) > 0) {
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf");
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=webhook-".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf");
|
||||
return;
|
||||
} else {
|
||||
setEventMessages($module->error, null, 'errors');
|
||||
@ -266,7 +195,7 @@ print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
|
||||
|
||||
// Configuration header
|
||||
$head = webhookAdminPrepareHead();
|
||||
print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "webhook@webhook");
|
||||
print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "webhook");
|
||||
|
||||
// Setup page goes here
|
||||
echo '<span class="opacitymedium">'.$langs->trans("WebhookSetupPage").'</span><br><br>';
|
||||
|
||||
@ -48,6 +48,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -205,6 +206,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
|
||||
|
||||
@ -48,7 +48,8 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
//$search_rowid = GETPOST('search_rowid');
|
||||
//$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
@ -207,6 +208,7 @@ if ($object->id > 0) {
|
||||
// // List of all actions
|
||||
// $filters = array();
|
||||
// $filters['search_agenda_label'] = $search_agenda_label;
|
||||
// $filters['search_rowid'] = $search_rowid;
|
||||
//
|
||||
// // TODO Replace this with same code than into list.php
|
||||
// show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
|
||||
|
||||
@ -52,6 +52,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
// Load variables for pagination
|
||||
@ -249,6 +250,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||
|
||||
@ -2,85 +2,8 @@
|
||||
|
||||
## Features
|
||||
|
||||
Description of the module...
|
||||
Provide features to be able to record online booking.
|
||||
|
||||
<!--
|
||||
{imgmd}
|
||||
-->
|
||||
|
||||
Other external modules are available on [Dolistore.com](https://www.dolistore.com).
|
||||
|
||||
## Translations
|
||||
|
||||
Translations can be completed manually by editing files into directories *langs*.
|
||||
|
||||
<!--
|
||||
This module contains also a sample configuration for Transifex, under the hidden directory [.tx](.tx), so it is possible to manage translation using this service.
|
||||
|
||||
For more informations, see the [translator's documentation](https://wiki.dolibarr.org/index.php/Translator_documentation).
|
||||
|
||||
There is a [Transifex project](https://transifex.com/projects/p/dolibarr-module-template) for this module.
|
||||
-->
|
||||
|
||||
<!--
|
||||
|
||||
## Installation
|
||||
|
||||
### From the ZIP file and GUI interface
|
||||
|
||||
If the module is a ready to deploy zip file, so with a name module_xxx-version.zip (like when downloading it from a market place like [Dolistore](https://www.dolistore.com)),
|
||||
go into menu ```Home - Setup - Modules - Deploy external module``` and upload the zip file.
|
||||
|
||||
Note: If this screen tell you that there is no "custom" directory, check that your setup is correct:
|
||||
|
||||
- In your Dolibarr installation directory, edit the ```htdocs/conf/conf.php``` file and check that following lines are not commented:
|
||||
|
||||
```php
|
||||
//$dolibarr_main_url_root_alt ...
|
||||
//$dolibarr_main_document_root_alt ...
|
||||
```
|
||||
|
||||
- Uncomment them if necessary (delete the leading ```//```) and assign a sensible value according to your Dolibarr installation
|
||||
|
||||
For example :
|
||||
|
||||
- UNIX:
|
||||
```php
|
||||
$dolibarr_main_url_root_alt = '/custom';
|
||||
$dolibarr_main_document_root_alt = '/var/www/Dolibarr/htdocs/custom';
|
||||
```
|
||||
|
||||
- Windows:
|
||||
```php
|
||||
$dolibarr_main_url_root_alt = '/custom';
|
||||
$dolibarr_main_document_root_alt = 'C:/My Web Sites/Dolibarr/htdocs/custom';
|
||||
```
|
||||
|
||||
### From a GIT repository
|
||||
|
||||
Clone the repository in ```$dolibarr_main_document_root_alt/bookcal```
|
||||
|
||||
```sh
|
||||
cd ....../custom
|
||||
git clone git@github.com:gitlogin/bookcal.git bookcal
|
||||
```
|
||||
|
||||
### <a name="final_steps"></a>Final steps
|
||||
|
||||
From your browser:
|
||||
|
||||
- Log into Dolibarr as a super-administrator
|
||||
- Go to "Setup" -> "Modules"
|
||||
- You should now be able to find and enable the module
|
||||
|
||||
-->
|
||||
|
||||
## Licenses
|
||||
|
||||
### Main code
|
||||
|
||||
GPLv3 or (at your option) any later version. See file COPYING for more information.
|
||||
|
||||
### Documentation
|
||||
|
||||
All texts and readmes are licensed under GFDL.
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
@ -50,6 +49,8 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} 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_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -255,6 +256,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php';
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
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/images.lib.php';
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php';
|
||||
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
@ -50,6 +49,8 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} 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_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -255,6 +256,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php';
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
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/images.lib.php';
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php';
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ function printDropdownBookmarksList()
|
||||
|
||||
$authorized_var=array('limit','optioncss','contextpage');
|
||||
$url = $_SERVER["PHP_SELF"];
|
||||
$url_param=array();
|
||||
$url_param = array();
|
||||
if (!empty($_SERVER["QUERY_STRING"])) {
|
||||
if (is_array($_GET)) {
|
||||
foreach ($_GET as $key => $val) {
|
||||
@ -79,7 +79,7 @@ function printDropdownBookmarksList()
|
||||
|
||||
$url .= ($tmpurl ? '?'.$tmpurl : '');
|
||||
if (!empty($url_param)) {
|
||||
$url .= '&'.implode('&', $url_param);
|
||||
$url .= (strpos($url, '?') > 0 ? '&' : '?').implode('&', $url_param);
|
||||
}
|
||||
|
||||
$searchForm = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
|
||||
@ -203,15 +203,12 @@ function printDropdownBookmarksList()
|
||||
</div>
|
||||
';
|
||||
|
||||
if ($bookmarkNb) {
|
||||
$html .= '
|
||||
$html .= '
|
||||
<!-- Menu Body -->
|
||||
<div class="bookmark-body dropdown-body">
|
||||
'.$bookmarkList.'
|
||||
<span id="top-bookmark-search-nothing-found" class="hidden-search-result opacitymedium">'.dol_escape_htmltag($langs->trans("NoBookmarkFound")).'</span>
|
||||
<div class="bookmark-body dropdown-body">'.$bookmarkList.'
|
||||
<span id="top-bookmark-search-nothing-found" class="'.($bookmarkNb ? 'hidden-search-result ' : '').'opacitymedium">'.dol_escape_htmltag($langs->trans("NoBookmarkFound")).'</span>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
$html .= '<!-- script to open/close the popup -->
|
||||
<script>
|
||||
|
||||
@ -29,8 +29,6 @@ require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
|
||||
$langs->loadLangs(array('bookmarks', 'admin'));
|
||||
|
||||
// Get Parameters
|
||||
$id = GETPOST("id", 'int');
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$show_files = GETPOST('show_files', 'int');
|
||||
@ -40,7 +38,9 @@ $toselect = GETPOST('toselect', 'array');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bookmarklist'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$mode = GETPOST('mode', 'aZ09');
|
||||
$mode = GETPOST('mode', 'aZ');
|
||||
|
||||
$id = GETPOST("id", 'int');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -63,10 +63,17 @@ if (!$sortorder) {
|
||||
|
||||
// Initialize Objects
|
||||
$object = new Bookmark($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$arrayfields = array();
|
||||
$hookmanager->initHooks(array('bookmarklist')); // Note that conf->hooks_modules contains array
|
||||
|
||||
if ($id > 0) {
|
||||
$object->fetch($id);
|
||||
}
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
||||
// Security check
|
||||
restrictedArea($user, 'bookmark', $object);
|
||||
|
||||
@ -88,18 +95,39 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
if ($action == 'delete' && $permissiontodelete) {
|
||||
$object->fetch($id);
|
||||
$res = $object->delete($user);
|
||||
if ($res > 0) {
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
$parameters = array();
|
||||
$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)) {
|
||||
// Selection of new fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|
||||
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
|
||||
$massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
|
||||
}
|
||||
|
||||
// Mass actions
|
||||
$objectclass = 'Bookmark';
|
||||
$objectlabel = 'Bookmark';
|
||||
$uploaddir = $conf->bookmark->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
if ($action == 'delete' && $permissiontodelete) {
|
||||
$object->fetch($id);
|
||||
$res = $object->delete($user);
|
||||
if ($res > 0) {
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@ -108,16 +136,34 @@ if ($action == 'delete' && $permissiontodelete) {
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
//$help_url = "EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject";
|
||||
$help_url = '';
|
||||
$title = $langs->trans("Bookmarks");
|
||||
$morejs = array();
|
||||
$morecss = array();
|
||||
|
||||
llxHeader('', $title);
|
||||
|
||||
// Build and execute select
|
||||
// --------------------------------------------------------------------
|
||||
$sql = "SELECT b.rowid, b.dateb, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,";
|
||||
$sql .= " u.login, u.lastname, u.firstname";
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
|
||||
}
|
||||
}
|
||||
// Add fields from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||
|
||||
$sqlfields = $sql; // $sql fields to remove for count total
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."bookmark as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid";
|
||||
$sql .= " WHERE 1=1";
|
||||
$sql .= " AND b.entity IN (".getEntity('bookmark').")";
|
||||
if (!$user->admin) {
|
||||
@ -159,7 +205,18 @@ if (!$resql) {
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
|
||||
// Output page
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
llxHeader('', $title);
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
$param = '';
|
||||
if (!empty($mode)) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
}
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
@ -169,8 +226,12 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
|
||||
$moreforfilter = '';
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
// Add $param from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$param .= $hookmanager->resPrint;
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
@ -198,18 +259,59 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', $permissiontoadd);
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
// Add code for pre mass action (confirmation or email presend form)
|
||||
$topicmail = "SendBookmarkRef";
|
||||
$modelmail = "bookmark";
|
||||
$objecttmp = new Bookmark($db);
|
||||
$trackid = 'bookmark'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
$moreforfilter .= $hookmanager->resPrint;
|
||||
} else {
|
||||
$moreforfilter = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
if (!empty($moreforfilter)) {
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
print $moreforfilter;
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
|
||||
// Fields title search
|
||||
// --------------------------------------------------------------------
|
||||
// TODO
|
||||
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
|
||||
// Fields title label
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
//print "<td> </td>";
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, '', $sortfield, $sortorder);
|
||||
@ -217,102 +319,176 @@ print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "b.target", "", $param,
|
||||
print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "b.dateb", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
|
||||
// Loop on record
|
||||
// --------------------------------------------------------------------
|
||||
$i = 0;
|
||||
while ($i < min($num, $limit)) {
|
||||
$savnbfield = $totalarray['nbfield'];
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||
while ($i < $imaxinloop) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if (empty($obj)) {
|
||||
break; // Should not happen
|
||||
}
|
||||
|
||||
$object->id = $obj->rowid;
|
||||
$object->ref = $obj->rowid;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Id
|
||||
print '<td class="nowraponall">';
|
||||
print $object->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
$linkintern = 1;
|
||||
if (preg_match('/^http/i', $obj->url)) {
|
||||
$linkintern = 0;
|
||||
}
|
||||
$title = $obj->title;
|
||||
$link = $obj->url;
|
||||
$canedit = $permissiontoadd;
|
||||
$candelete = $permissiontodelete;
|
||||
|
||||
// Title
|
||||
print '<td class="tdoverflowmax200" alt="'.dol_escape_htmltag($title).'">';
|
||||
print dol_escape_htmltag($title);
|
||||
print "</td>\n";
|
||||
|
||||
// Url
|
||||
print '<td class="tdoverflowmax200">';
|
||||
if (empty($linkintern)) {
|
||||
print img_picto('', 'url', 'class="pictofixedwidth"');
|
||||
print '<a class="" href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
|
||||
} else {
|
||||
//print img_picto('', 'rightarrow', 'class="pictofixedwidth"');
|
||||
print '<a class="" href="'.$obj->url.'">';
|
||||
}
|
||||
print $link;
|
||||
print '</a>';
|
||||
print "</td>\n";
|
||||
|
||||
// Target
|
||||
print '<td class="center">';
|
||||
if ($obj->target == 0) {
|
||||
print $langs->trans("BookmarkTargetReplaceWindowShort");
|
||||
}
|
||||
if ($obj->target == 1) {
|
||||
print $langs->trans("BookmarkTargetNewWindowShort");
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
// Author
|
||||
print '<td class="center">';
|
||||
if ($obj->fk_user > 0) {
|
||||
if (empty($conf->cache['users'][$obj->fk_user])) {
|
||||
$tmpuser = new User($db);
|
||||
$tmpuser->fetch($obj->fk_user);
|
||||
$conf->cache['users'][$obj->fk_user] = $tmpuser;
|
||||
if ($mode == 'kanban') {
|
||||
if ($i == 0) {
|
||||
print '<tr><td colspan="'.$savnbfield.'">';
|
||||
print '<div class="box-flex-container">';
|
||||
}
|
||||
$tmpuser = $conf->cache['users'][$obj->fk_user];
|
||||
print $tmpuser->getNomUrl(-1);
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("Everybody").'</span>';
|
||||
if (!$user->admin) {
|
||||
$candelete = false;
|
||||
$canedit = false;
|
||||
// Output Kanban
|
||||
print $object->getKanbanView('');
|
||||
if ($i == ($imaxinloop - 1)) {
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
} else {
|
||||
// Show here line of result
|
||||
$j = 0;
|
||||
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
// Date creation
|
||||
print '<td class="center" title="'.dol_escape_htmltag(dol_print_date($db->jdate($obj->dateb), 'dayhour')).'">'.dol_print_date($db->jdate($obj->dateb), 'day')."</td>";
|
||||
// Id
|
||||
print '<td class="nowraponall">';
|
||||
print $object->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
// Position
|
||||
print '<td class="right">'.$obj->position."</td>";
|
||||
$linkintern = 1;
|
||||
if (preg_match('/^http/i', $obj->url)) {
|
||||
$linkintern = 0;
|
||||
}
|
||||
$title = $obj->title;
|
||||
$link = $obj->url;
|
||||
$canedit = $permissiontoadd;
|
||||
$candelete = $permissiontodelete;
|
||||
|
||||
// Actions
|
||||
print '<td class="nowraponall right">';
|
||||
if ($canedit) {
|
||||
print '<a class="editfielda marginleftonly marginrightonly" href="'.DOL_URL_ROOT.'/bookmarks/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit()."</a>";
|
||||
// Title
|
||||
print '<td class="tdoverflowmax200" alt="'.dol_escape_htmltag($title).'">';
|
||||
print dol_escape_htmltag($title);
|
||||
print "</td>\n";
|
||||
|
||||
// Url
|
||||
print '<td class="tdoverflowmax200">';
|
||||
if (empty($linkintern)) {
|
||||
print img_picto('', 'url', 'class="pictofixedwidth"');
|
||||
print '<a class="" href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
|
||||
} else {
|
||||
//print img_picto('', 'rightarrow', 'class="pictofixedwidth"');
|
||||
print '<a class="" href="'.$obj->url.'">';
|
||||
}
|
||||
print $link;
|
||||
print '</a>';
|
||||
print "</td>\n";
|
||||
|
||||
// Target
|
||||
print '<td class="center">';
|
||||
if ($obj->target == 0) {
|
||||
print $langs->trans("BookmarkTargetReplaceWindowShort");
|
||||
}
|
||||
if ($obj->target == 1) {
|
||||
print $langs->trans("BookmarkTargetNewWindowShort");
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
// Author
|
||||
print '<td class="center">';
|
||||
if ($obj->fk_user > 0) {
|
||||
if (empty($conf->cache['users'][$obj->fk_user])) {
|
||||
$tmpuser = new User($db);
|
||||
$tmpuser->fetch($obj->fk_user);
|
||||
$conf->cache['users'][$obj->fk_user] = $tmpuser;
|
||||
}
|
||||
$tmpuser = $conf->cache['users'][$obj->fk_user];
|
||||
print $tmpuser->getNomUrl(-1);
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("Everybody").'</span>';
|
||||
if (!$user->admin) {
|
||||
$candelete = false;
|
||||
$canedit = false;
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
// Date creation
|
||||
print '<td class="center" title="'.dol_escape_htmltag(dol_print_date($db->jdate($obj->dateb), 'dayhour')).'">'.dol_print_date($db->jdate($obj->dateb), 'day')."</td>";
|
||||
|
||||
// Position
|
||||
print '<td class="right">'.$obj->position."</td>";
|
||||
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
if ($candelete) {
|
||||
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$obj->rowid.'">'.img_delete().'</a>';
|
||||
}
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
// Show total line
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||
|
||||
// If no record found
|
||||
if ($num == 0) {
|
||||
$colspan = 1;
|
||||
foreach ($arrayfields as $key => $val) {
|
||||
if (!empty($val['checked'])) {
|
||||
$colspan++;
|
||||
}
|
||||
}
|
||||
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</div>'."\n";
|
||||
|
||||
print '</form>'."\n";
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
@ -560,6 +560,7 @@ if ($object->fetch($id) >= 0) {
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="limit" value="'.$limit.'">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
@ -244,7 +244,7 @@ $thirdpartystatic = new Societe($db);
|
||||
|
||||
$result = $object->fetch($id, $ref);
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db, 'Payement '.$id.' not found in database');
|
||||
dol_print_error($db, 'Payment '.$id.' not found in database');
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -868,7 +868,7 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && isModEnabled("ba
|
||||
//}
|
||||
|
||||
/*
|
||||
* Payement Loan
|
||||
* Payment Loan
|
||||
*/
|
||||
|
||||
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && isModEnabled('loan') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
|
||||
|
||||
@ -83,6 +83,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
// Security check
|
||||
@ -288,6 +289,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
show_actions_done($conf, $langs, $db, $objthirdparty, $object, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||
}
|
||||
|
||||
@ -43,6 +43,8 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
@ -265,6 +267,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||
|
||||
@ -684,7 +684,6 @@ if (!$error && $massaction == 'cancelorders') {
|
||||
|
||||
$nbok = 0;
|
||||
|
||||
|
||||
$orders = GETPOST('toselect', 'array');
|
||||
foreach ($orders as $id_order) {
|
||||
$cmd = new Commande($db);
|
||||
|
||||
@ -8582,6 +8582,9 @@ class Form
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
return '';
|
||||
}
|
||||
if (empty($array)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
|
||||
|
||||
|
||||
@ -1646,7 +1646,7 @@ class FormMail extends Form
|
||||
$tmparray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = 'SecureKeyPAYMENTUniquePerContractLine';
|
||||
}
|
||||
|
||||
//Online payement link
|
||||
//Online payment link
|
||||
if (isModEnabled('adherent')) {
|
||||
$tmparray['__ONLINEPAYMENTLINK_MEMBER__'] = 'OnlinePaymentLinkUniquePerMember';
|
||||
}
|
||||
|
||||
@ -377,7 +377,7 @@ function societe_prepare_head(Societe $object)
|
||||
$head[$h][1] = $langs->trans("Events");
|
||||
if (isModEnabled('agenda')&& (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||
$nbEvent = 0;
|
||||
// Enable caching of thirdrparty count actioncomm
|
||||
// Enable caching of thirdparty count actioncomm
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||
$cachekey = 'count_events_thirdparty_'.$object->id;
|
||||
$dataretrieved = dol_getcache($cachekey);
|
||||
@ -1418,8 +1418,18 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($num == 0) {
|
||||
$colspan = 1 + ($showuserlogin ? 1 : 0);
|
||||
foreach ($arrayfields as $key => $val) {
|
||||
if (!empty($val['checked'])) {
|
||||
$colspan++;
|
||||
}
|
||||
}
|
||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||
}
|
||||
} else {
|
||||
$colspan = 2;
|
||||
$colspan = 1 + ($showuserlogin ? 1 : 0);
|
||||
foreach ($arrayfields as $key => $val) {
|
||||
if (!empty($val['checked'])) {
|
||||
$colspan++;
|
||||
@ -1723,7 +1733,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
||||
//TODO Add limit in nb of results
|
||||
if ($sql) {
|
||||
$sql .= $db->order($sortfield_new, $sortorder);
|
||||
|
||||
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$i = 0;
|
||||
@ -1839,7 +1851,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
||||
if ($donetodo) {
|
||||
$out .= '<td class="liste_titre"></td>';
|
||||
}
|
||||
$out .= '<td class="liste_titre"></td>';
|
||||
|
||||
$out .= '<td class="liste_titre"><input type="text" class="width50" name="search_rowid" value="'.(isset($filters['search_rowid']) ? $filters['search_rowid'] : '').'"></td>';
|
||||
$out .= '<td class="liste_titre"></td>';
|
||||
$out .= '<td class="liste_titre">';
|
||||
$out .= $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1, 0, (empty($conf->global->AGENDA_USE_MULTISELECT_TYPE) ? 0 : 1), 1, 'minwidth100 maxwidth150');
|
||||
@ -1971,7 +1984,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
||||
$out .= '</td>';
|
||||
|
||||
// Date
|
||||
$out .= '<td class="center nowrap">';
|
||||
$out .= '<td class="center nowraponall">';
|
||||
$out .= dol_print_date($histo[$key]['datestart'], 'dayhour', 'tzuserrel');
|
||||
if ($histo[$key]['dateend'] && $histo[$key]['dateend'] != $histo[$key]['datestart']) {
|
||||
$tmpa = dol_getdate($histo[$key]['datestart'], true);
|
||||
@ -2223,6 +2236,9 @@ function addOtherFilterSQL(&$sql, $donetodo, $now, $filters)
|
||||
if (is_array($filters) && $filters['search_agenda_label']) {
|
||||
$sql .= natural_search('a.label', $filters['search_agenda_label']);
|
||||
}
|
||||
if (is_array($filters) && $filters['search_rowid']) {
|
||||
$sql .= natural_search('a.id', $filters['search_rowid'], 1);
|
||||
}
|
||||
|
||||
return $sql;
|
||||
}
|
||||
|
||||
@ -12232,7 +12232,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
||||
$out .= '<h3 class="timeline-header">';
|
||||
|
||||
// Author of event
|
||||
$out .= '<span class="messaging-author">';
|
||||
$out .= '<div class="messaging-author inline-block">';
|
||||
if ($histo[$key]['userid'] > 0) {
|
||||
if (!isset($userGetNomUrlCache[$histo[$key]['userid']])) { // is in cache ?
|
||||
$userstatic->fetch($histo[$key]['userid']);
|
||||
@ -12240,10 +12240,10 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
||||
}
|
||||
$out .= $userGetNomUrlCache[$histo[$key]['userid']];
|
||||
}
|
||||
$out .= '</span>';
|
||||
$out .= '</div>';
|
||||
|
||||
// Title
|
||||
$out .= ' <span class="messaging-title">';
|
||||
$out .= ' <div class="messaging-title inline-block">';
|
||||
|
||||
if (preg_match('/^TICKET_MSG/', $actionstatic->code)) {
|
||||
$out .= $langs->trans('TicketNewMessage');
|
||||
@ -12265,7 +12265,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
||||
}
|
||||
}
|
||||
|
||||
$out .= '</span>';
|
||||
$out .= '</div>';
|
||||
|
||||
$out .= '</h3>';
|
||||
|
||||
|
||||
@ -68,6 +68,7 @@ $shmoffset = 1000; // Max number of entries found into a language file. If too l
|
||||
function dol_setcache($memoryid, $data, $expire = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$result = 0;
|
||||
|
||||
if (strpos($memoryid, 'count_') === 0) { // The memoryid key start with 'count_...'
|
||||
@ -120,6 +121,10 @@ function dol_setcache($memoryid, $data, $expire = 0)
|
||||
} elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) { // This is a really not reliable cache ! Use Memcached instead.
|
||||
// Using shmop
|
||||
$result = dol_setshmop($memoryid, $data, $expire);
|
||||
} else {
|
||||
// No intersession cache system available, we use at least the perpage cache
|
||||
$conf->cache['cachememory_'.$memoryid] = $data;
|
||||
$result = is_array($data) ? count($data) : (is_scalar($data) ? strlen($data) : 0);
|
||||
}
|
||||
|
||||
return $result;
|
||||
@ -193,6 +198,11 @@ function dol_getcache($memoryid)
|
||||
// Using shmop
|
||||
$data = dol_getshmop($memoryid);
|
||||
return $data;
|
||||
} else {
|
||||
// No intersession cache system available, we use at least the perpage cache
|
||||
if (isset($conf->cache['cachememory_'.$memoryid])) {
|
||||
return $conf->cache['cachememory_'.$memoryid];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@ -198,7 +198,7 @@ class modWebhook extends DolibarrModules
|
||||
$this->dictionaries = array();
|
||||
/* Example:
|
||||
$this->dictionaries=array(
|
||||
'langs'=>'webhook@webhook',
|
||||
'langs'=>'',
|
||||
// List of tables we want to see into dictonnary editor
|
||||
'tabname'=>array(MAIN_DB_PREFIX."table1", MAIN_DB_PREFIX."table2", MAIN_DB_PREFIX."table3"),
|
||||
// Label of tables
|
||||
@ -289,7 +289,7 @@ class modWebhook extends DolibarrModules
|
||||
'mainmenu'=>'webhook',
|
||||
'leftmenu'=>'',
|
||||
'url'=>'/webhook/webhookindex.php',
|
||||
'langs'=>'webhook@webhook', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'langs'=>'', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000 + $r,
|
||||
'enabled'=>'$conf->webhook->enabled', // Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled.
|
||||
'perms'=>'1', // Use 'perms'=>'$user->rights->webhook->webhook_target->read' if you want your menu with a permission rules
|
||||
@ -306,7 +306,7 @@ class modWebhook extends DolibarrModules
|
||||
'mainmenu'=>'webhook',
|
||||
'leftmenu'=>'webhook_target',
|
||||
'url'=>'/webhook/webhookindex.php',
|
||||
'langs'=>'webhook@webhook', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'langs'=>'', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000+$r,
|
||||
'enabled'=>'$conf->webhook->enabled', // Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled.
|
||||
'perms'=>'$user->rights->webhook->webhook_target->read', // Use 'perms'=>'$user->rights->webhook->level1->level2' if you want your menu with a permission rules
|
||||
@ -320,7 +320,7 @@ class modWebhook extends DolibarrModules
|
||||
'mainmenu'=>'webhook',
|
||||
'leftmenu'=>'webhook_webhook_target_list',
|
||||
'url'=>'/webhook/webhook_target_list.php',
|
||||
'langs'=>'webhook@webhook', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'langs'=>'', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000+$r,
|
||||
'enabled'=>'$conf->webhook->enabled', // Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->webhook->webhook_target->read', // Use 'perms'=>'$user->rights->webhook->level1->level2' if you want your menu with a permission rules
|
||||
@ -334,7 +334,7 @@ class modWebhook extends DolibarrModules
|
||||
'mainmenu'=>'webhook',
|
||||
'leftmenu'=>'webhook_webhook_target_new',
|
||||
'url'=>'/webhook/webhook_target_card.php?action=create',
|
||||
'langs'=>'webhook@webhook', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'langs'=>'', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000+$r,
|
||||
'enabled'=>'$conf->webhook->enabled', // Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->webhook->webhook_target->write', // Use 'perms'=>'$user->rights->webhook->level1->level2' if you want your menu with a permission rules
|
||||
@ -353,7 +353,7 @@ class modWebhook extends DolibarrModules
|
||||
'leftmenu'=>'webhook_webhook_target',
|
||||
'url'=>'/webhook/webhook_target_list.php',
|
||||
// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'langs'=>'webhook@webhook',
|
||||
'langs'=>'',
|
||||
'position'=>1100+$r,
|
||||
// Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'enabled'=>'$conf->webhook->enabled',
|
||||
@ -373,7 +373,7 @@ class modWebhook extends DolibarrModules
|
||||
'leftmenu'=>'webhook_webhook_target',
|
||||
'url'=>'/webhook/webhook_target_card.php?action=create',
|
||||
// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'langs'=>'webhook@webhook',
|
||||
'langs'=>'',
|
||||
'position'=>1100+$r,
|
||||
// Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'enabled'=>'$conf->webhook->enabled',
|
||||
@ -389,7 +389,6 @@ class modWebhook extends DolibarrModules
|
||||
$r = 1;
|
||||
/* BEGIN MODULEBUILDER EXPORT WEBHOOK_TARGET */
|
||||
/*
|
||||
$langs->load("webhook@webhook");
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]='Webhook_targetLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->export_icon[$r]='webhook_target@webhook';
|
||||
@ -420,7 +419,6 @@ class modWebhook extends DolibarrModules
|
||||
$r = 1;
|
||||
/* BEGIN MODULEBUILDER IMPORT WEBHOOK_TARGET */
|
||||
/*
|
||||
$langs->load("webhook@webhook");
|
||||
$this->import_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->import_label[$r]='Webhook_targetLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->import_icon[$r]='webhook_target@webhook';
|
||||
@ -470,15 +468,6 @@ class modWebhook extends DolibarrModules
|
||||
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
||||
}
|
||||
|
||||
// Create extrafields during init
|
||||
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
//$extrafields = new ExtraFields($this->db);
|
||||
//$result1=$extrafields->addExtraField('webhook_myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled');
|
||||
//$result2=$extrafields->addExtraField('webhook_myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled');
|
||||
//$result3=$extrafields->addExtraField('webhook_myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled');
|
||||
//$result4=$extrafields->addExtraField('webhook_myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled');
|
||||
//$result5=$extrafields->addExtraField('webhook_myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled');
|
||||
|
||||
// Permissions
|
||||
$this->remove($options);
|
||||
|
||||
|
||||
@ -211,7 +211,7 @@ class pdf_paiement
|
||||
if (!empty($socid)) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
}
|
||||
// If global param PAYMENTS_REPORT_GROUP_BY_MOD is set, payement are ordered by paiement_code
|
||||
// If global param PAYMENTS_REPORT_GROUP_BY_MOD is set, payment are ordered by paiement_code
|
||||
if (!empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) {
|
||||
$sql .= " ORDER BY paiement_code ASC, p.datep ASC, pf.fk_paiement ASC";
|
||||
} else {
|
||||
@ -249,7 +249,7 @@ class pdf_paiement
|
||||
if (!empty($socid)) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
}
|
||||
// If global param PAYMENTS_FOURN_REPORT_GROUP_BY_MOD is set, payement fourn are ordered by paiement_code
|
||||
// If global param PAYMENTS_FOURN_REPORT_GROUP_BY_MOD is set, payment fourn are ordered by paiement_code
|
||||
if (!empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD)) {
|
||||
$sql .= " ORDER BY paiement_code ASC, p.datep ASC, pf.fk_paiementfourn ASC";
|
||||
} else {
|
||||
|
||||
@ -68,6 +68,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECTS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECTS));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
// Security check
|
||||
@ -231,6 +232,8 @@ if (!empty($object->id)) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||
}
|
||||
|
||||
|
||||
@ -55,6 +55,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -230,6 +231,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
|
||||
|
||||
@ -35,7 +35,6 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
|
||||
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('hrm', 'other'));
|
||||
|
||||
@ -54,6 +53,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -212,6 +212,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
|
||||
|
||||
@ -55,6 +55,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -224,7 +225,9 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$object->fields['label']=array(); // Usefull to get only get agenda events linked to position (this object doesn't need label of ref field, but show_actions_done() needs it to work correctly)
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
$object->fields['label']=array(); // Usefull to get only agenda events linked to position (this object doesn't need label of ref field, but show_actions_done() needs it to work correctly)
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
|
||||
|
||||
@ -54,6 +54,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
// Get Parameters for Pagination
|
||||
@ -218,6 +219,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
|
||||
|
||||
@ -2407,8 +2407,7 @@ function show_elem($fieldssource, $pos, $key, $var, $nostyle = '')
|
||||
} else {
|
||||
print ' - ';
|
||||
}
|
||||
//print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ExampleOnFirstLine").': </span>';
|
||||
print '<i class="opacitymedium">'.$example.'</i>';
|
||||
print '<i class="opacitymedium">'.dol_escape_htmltag($example).'</i>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -51,6 +51,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -245,6 +246,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
|
||||
|
||||
@ -145,6 +145,7 @@ Box=Widget
|
||||
Boxes=Widgets
|
||||
MaxNbOfLinesForBoxes=Max. number of lines for widgets
|
||||
AllWidgetsWereEnabled=All available widgets are enabled
|
||||
WidgetAvailable=Widget available
|
||||
PositionByDefault=Default order
|
||||
Position=Position
|
||||
MenusDesc=Menu managers set content of the two menu bars (horizontal and vertical).
|
||||
@ -2299,7 +2300,7 @@ ExportUseLowMemoryMode=Use a low memory mode
|
||||
ExportUseLowMemoryModeHelp=Use the low memory mode to generate the dump file (compression is done through a pipe instead of into the PHP memory). This method does not allow to check that the file is complete and error message can't be reported if it fails. Use it if you experience not enough memory errors.
|
||||
|
||||
ModuleWebhookName = Webhook
|
||||
ModuleWebhookDesc = Interface to catch dolibarr triggers and send it to an URL
|
||||
ModuleWebhookDesc = Interface to catch dolibarr triggers and send data of the event to an URL
|
||||
WebhookSetup = Webhook setup
|
||||
Settings = Settings
|
||||
WebhookSetupPage = Webhook setup page
|
||||
|
||||
@ -457,7 +457,7 @@ class Loan extends CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Tag loan as payement as unpaid
|
||||
* Tag loan as payment as unpaid
|
||||
* @deprecated
|
||||
* @see setUnpaid()
|
||||
* @param User $user Object user making change
|
||||
@ -471,7 +471,7 @@ class Loan extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag loan as payement as unpaid
|
||||
* Tag loan as payment as unpaid
|
||||
*
|
||||
* @param User $user Object user making change
|
||||
* @return int <0 if KO, >0 if OK
|
||||
|
||||
@ -78,7 +78,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
dol_include_once('/mymodule/class/myobject.class.php');
|
||||
dol_include_once('/mymodule/lib/mymodule_myobject.lib.php');
|
||||
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("mymodule@mymodule", "other"));
|
||||
|
||||
@ -97,6 +96,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -309,6 +309,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
|
||||
|
||||
@ -254,6 +254,9 @@ if (empty($reshook)) {
|
||||
$objectlabel = 'MyObject';
|
||||
$uploaddir = $conf->mymodule->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
// You can add more action here
|
||||
// if ($action == 'xxx' && $permissiontoxxx) ...
|
||||
}
|
||||
|
||||
|
||||
@ -557,7 +560,6 @@ $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('che
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
|
||||
|
||||
// Fields title search
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre_filter">';
|
||||
@ -630,7 +632,7 @@ $totalarray['nbfield'] = 0;
|
||||
print '<tr class="liste_titre">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++; // For the column action
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
@ -662,10 +664,12 @@ print $hookmanager->resPrint;
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++; // For the column action
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
|
||||
// Detect if we need a fetch on each output line
|
||||
$needToFetchEachLine = 0;
|
||||
|
||||
@ -52,6 +52,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -242,6 +243,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||
|
||||
@ -51,6 +51,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
|
||||
@ -45,6 +45,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
// Security check
|
||||
@ -217,6 +218,7 @@ if ($id > 0 || $ref) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||
|
||||
@ -47,6 +47,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -221,9 +222,9 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, '');
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,6 +61,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$hookmanager->initHooks(array('projectcardinfo'));
|
||||
@ -213,6 +214,8 @@ if (!empty($object->id)) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||
}
|
||||
|
||||
|
||||
@ -61,6 +61,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$hookmanager->initHooks(array('projectcardinfo'));
|
||||
@ -213,6 +214,8 @@ if (!empty($object->id)) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
show_actions_messaging($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||
}
|
||||
|
||||
|
||||
@ -51,6 +51,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -247,6 +248,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, 'recruitment');
|
||||
|
||||
@ -50,6 +50,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -243,6 +244,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, 'recruitment');
|
||||
|
||||
@ -54,6 +54,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -179,6 +180,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||
|
||||
@ -48,6 +48,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -199,12 +200,18 @@ if ($socid > 0) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
|
||||
// Try to know count of actioncomm from cache
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||
$cachekey = 'count_events_thirdparty_'.$object->id;
|
||||
$nbEvent = dol_getcache($cachekey);
|
||||
|
||||
// print load_fiche_titre($langs->trans("ActionsOnCompany"), $newcardbutton, '');
|
||||
print_barre_liste($langs->trans("ActionsOnCompany"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
|
||||
print_barre_liste($langs->trans("ActionsOnCompany").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>': ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
|
||||
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
|
||||
|
||||
@ -52,6 +52,11 @@ class Societe extends CommonObject
|
||||
use CommonIncoterm;
|
||||
use CommonSocialNetworks;
|
||||
|
||||
/**
|
||||
* @var string ID of module.
|
||||
*/
|
||||
public $module = 'societe';
|
||||
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
*/
|
||||
|
||||
@ -46,6 +46,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
// Security check
|
||||
@ -194,12 +195,18 @@ if ($socid > 0) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
|
||||
// Try to know count of actioncomm from cache
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||
$cachekey = 'count_events_thirdparty_'.$object->id;
|
||||
$nbEvent = dol_getcache($cachekey);
|
||||
|
||||
// print load_fiche_titre($langs->trans("ActionsOnCompany"), $newcardbutton, '');
|
||||
print_barre_liste($langs->trans("ActionsOnCompany"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
|
||||
print_barre_liste($langs->trans("ActionsOnCompany").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
|
||||
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_messaging($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||
|
||||
@ -31,7 +31,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
bottom: 0;
|
||||
width: 4px;
|
||||
background: #ddd;
|
||||
left: 31px;
|
||||
left: 25px;
|
||||
margin: 0;
|
||||
border-radius: 2px;
|
||||
}
|
||||
@ -56,7 +56,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
margin-top: 0;
|
||||
background: #fff;
|
||||
color: #444;
|
||||
margin-left: 60px;
|
||||
margin-left: 50px;
|
||||
margin-right: 0px;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
@ -123,7 +123,7 @@ a.timeline-btn:hover
|
||||
color: #333;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
padding: 10px;
|
||||
font-size: 14px;
|
||||
font-size: 1em;
|
||||
font-weight: normal;
|
||||
line-height: 1.1;
|
||||
}
|
||||
@ -148,14 +148,14 @@ a.timeline-btn:hover
|
||||
.timeline > li > .ion {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
font-size: 15px;
|
||||
font-size: 1em;
|
||||
line-height: 30px;
|
||||
position: absolute;
|
||||
color: #666;
|
||||
background: #d2d6de;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
left: 18px;
|
||||
left: 12px;
|
||||
top: 5px;
|
||||
}
|
||||
.timeline > .time-label > span {
|
||||
@ -211,3 +211,10 @@ a.timeline-btn:hover
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
/* Force values for small screen 767 */
|
||||
@media only screen and (max-width: 767px)
|
||||
{
|
||||
.messaging-author.inline-block {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,6 +71,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$object = new Ticket($db);
|
||||
@ -261,6 +262,8 @@ if (!empty($object->id)) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||
}
|
||||
|
||||
|
||||
@ -73,6 +73,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
// Initialize technical object to manage hooks of ticket. Note that conf->hooks_modules contains array array
|
||||
@ -1554,6 +1555,8 @@ if ($action == 'create' || $action == 'presend') {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
show_actions_messaging($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||
}
|
||||
|
||||
|
||||
@ -70,6 +70,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$object = new Ticket($db);
|
||||
@ -258,6 +259,8 @@ if (!empty($object->id)) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
show_actions_messaging($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||
}
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ class Target extends CommonObject
|
||||
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',),
|
||||
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,),
|
||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
|
||||
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>2000, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Disabled', '1'=>'Enabled'), 'validate'=>'1',),
|
||||
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>2000, 'notnull'=>1, 'default'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Disabled', '1'=>'Enabled'), 'validate'=>'1',),
|
||||
);
|
||||
public $rowid;
|
||||
public $ref;
|
||||
@ -218,7 +218,7 @@ class Target extends CommonObject
|
||||
*
|
||||
* @param User $user User that creates
|
||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
* @return int <0 if KO, Id of created object if OK
|
||||
* @return int <0 if KO, ID of created object if OK
|
||||
*/
|
||||
public function create(User $user, $notrigger = false)
|
||||
{
|
||||
@ -233,6 +233,7 @@ class Target extends CommonObject
|
||||
if ($resultvalidate <= 0) {
|
||||
return $resultvalidate;
|
||||
}
|
||||
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
@ -345,9 +346,10 @@ class Target extends CommonObject
|
||||
public function fetch($id, $ref = null)
|
||||
{
|
||||
$result = $this->fetchCommon($id, $ref);
|
||||
if ($result > 0 && !empty($this->table_element_line)) {
|
||||
$this->fetchLines();
|
||||
if (empty($this->ref)) {
|
||||
$this->ref = $this->id;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -60,9 +60,9 @@ function webhookAdminPrepareHead()
|
||||
//$this->tabs = array(
|
||||
// 'entity:-tabname:Title:@webhook:/webhook/mypage.php?id=__ID__'
|
||||
//); // to remove a tab
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'webhook@webhook');
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'webhook');
|
||||
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'webhook@webhook', 'remove');
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'webhook', 'remove');
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
@ -1,268 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/webhook/target_agenda.php
|
||||
* \ingroup webhook
|
||||
* \brief Tab of events on Target
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/webhook/class/target.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook_target.lib.php';
|
||||
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('other'));
|
||||
|
||||
// Get parameters
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$cancel = GETPOST('cancel', 'aZ09');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
|
||||
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' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
}
|
||||
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1) {
|
||||
// If $page is not defined, or '' or -1
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (!$sortfield) {
|
||||
$sortfield = 'a.datep,a.id';
|
||||
}
|
||||
if (!$sortorder) {
|
||||
$sortorder = 'DESC,DESC';
|
||||
}
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new Target($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->webhook->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('targetagenda', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// 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
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$upload_dir = $conf->webhook->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
|
||||
}
|
||||
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->rights->webhook->target->read;
|
||||
$permissiontoadd = $user->rights->webhook->target->write;
|
||||
} else {
|
||||
$permissiontoread = 1;
|
||||
$permissiontoadd = 1;
|
||||
}
|
||||
|
||||
// Security check (enable the most restrictive one)
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
//if ($user->socid > 0) $socid = $user->socid;
|
||||
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||
if (!isModEnabled('webhook') || !$permissiontoread) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
if ($object->id > 0) {
|
||||
$title = $langs->trans("Agenda");
|
||||
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = targetPrepareHead($object);
|
||||
|
||||
|
||||
print dol_get_fiche_head($head, 'agenda', $langs->trans("Target"), -1, $object->picto);
|
||||
|
||||
// Object card
|
||||
// ------------------------------------------------------------
|
||||
$linkback = '<a href="'.dol_buildpath('/webhook/target_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
/*
|
||||
// Ref customer
|
||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (isModEnabled('projet')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($permissiontoadd) {
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&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="'.newToken().'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $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->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ': '.$proj->getNomUrl();
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
$object->info($object->id);
|
||||
dol_print_object_info($object, 1);
|
||||
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
|
||||
// Actions buttons
|
||||
|
||||
$objthirdparty = $object;
|
||||
$objcon = new stdClass();
|
||||
|
||||
$out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id);
|
||||
$urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||
$out .= '&backtopage='.urlencode($urlbacktopage);
|
||||
$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 .= '&socid='.urlencode($objthirdparty->id);
|
||||
}
|
||||
$out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '');
|
||||
//$out.=$langs->trans("AddAnAction").' ';
|
||||
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
||||
//$out.="</a>";
|
||||
}
|
||||
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||
$param = '&id='.$object->id.'&socid='.$socid;
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
|
||||
|
||||
//print load_fiche_titre($langs->trans("ActionsOnTarget"), '', '');
|
||||
|
||||
// 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, $object->module);
|
||||
}
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -1,199 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/webhook/target_contact.php
|
||||
* \ingroup webhook
|
||||
* \brief Tab for contacts linked to Target
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/webhook/class/target.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook_target.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('companies', 'other', 'mails'));
|
||||
|
||||
$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$lineid = GETPOST('lineid', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new Target($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->webhook->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('targetcontact', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// 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
|
||||
|
||||
// Permissions
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->rights->webhook->target->read;
|
||||
$permission = $user->rights->webhook->target->write;
|
||||
} else {
|
||||
$permissiontoread = 1;
|
||||
$permission = 1;
|
||||
}
|
||||
|
||||
// Security check (enable the most restrictive one)
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
//if ($user->socid > 0) $socid = $user->socid;
|
||||
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||
if (!isModEnabled('webhook') || !$permissiontoread) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Add a new contact
|
||||
*/
|
||||
|
||||
if ($action == 'addcontact' && $permission) {
|
||||
$contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
||||
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
||||
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
|
||||
|
||||
if ($result >= 0) {
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
} else {
|
||||
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'swapstatut' && $permission) {
|
||||
// Toggle the status of a contact
|
||||
$result = $object->swapContactStatus(GETPOST('ligne', 'int'));
|
||||
} elseif ($action == 'deletecontact' && $permission) {
|
||||
// Deletes a contact
|
||||
$result = $object->delete_contact($lineid);
|
||||
|
||||
if ($result >= 0) {
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$title = $langs->trans('Target')." - ".$langs->trans('ContactsAddresses');
|
||||
$help_url = '';
|
||||
//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
$form = new Form($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
$contactstatic = new Contact($db);
|
||||
$userstatic = new User($db);
|
||||
|
||||
|
||||
/* *************************************************************************** */
|
||||
/* */
|
||||
/* View and edit mode */
|
||||
/* */
|
||||
/* *************************************************************************** */
|
||||
|
||||
if ($object->id) {
|
||||
/*
|
||||
* Show tabs
|
||||
*/
|
||||
$head = targetPrepareHead($object);
|
||||
|
||||
print dol_get_fiche_head($head, 'contact', $langs->trans("Target"), -1, $object->picto);
|
||||
|
||||
$linkback = '<a href="'.dol_buildpath('/webhook/target_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
/*
|
||||
// Ref customer
|
||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (isModEnabled('projet'))
|
||||
{
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($permissiontoadd)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&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="'.newToken().'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $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->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ': '.$proj->getNomUrl();
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Contacts lines (modules that overwrite templates must declare this into descriptor)
|
||||
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
|
||||
foreach ($dirtpls as $reldir) {
|
||||
$res = @include dol_buildpath($reldir.'/contacts.tpl.php');
|
||||
if ($res) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -381,7 +381,7 @@ if ($mode == 'modulesetup') {
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
|
||||
|
||||
$head = webhookAdminPrepareHead();
|
||||
print dol_get_fiche_head($head, 'targets', $langs->trans($page_name), -1, "webhook@webhook");
|
||||
print dol_get_fiche_head($head, 'targets', $langs->trans($page_name), -1, "webhook");
|
||||
}
|
||||
|
||||
// Example : Adding jquery code
|
||||
@ -625,6 +625,10 @@ while ($i < $imaxinloop) {
|
||||
break; // Should not happen
|
||||
}
|
||||
|
||||
if (empty($obj->ref)) {
|
||||
$obj->ref = $obj->rowid;
|
||||
}
|
||||
|
||||
// Store properties in $object
|
||||
$object->setVarsFromFetchObj($obj);
|
||||
|
||||
|
||||
@ -31,7 +31,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/workstation/lib/workstation_workstation.lib.php';
|
||||
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('workstation', 'other'));
|
||||
|
||||
@ -51,6 +50,7 @@ if (GETPOST('actioncode', 'array')) {
|
||||
$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_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
// Load variables for pagination
|
||||
@ -247,6 +247,7 @@ if ($object->id > 0) {
|
||||
// List of all actions
|
||||
$filters = array();
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user