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

This commit is contained in:
Frédéric FRANCE 2023-04-21 15:16:08 +02:00
commit 5f5fa38561
32 changed files with 156 additions and 111 deletions

View File

@ -720,7 +720,7 @@ if (!empty($moreforfilter)) {
} }
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $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 = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
if ($massactionbutton) { if ($massactionbutton) {
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1); $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
} }

View File

@ -369,14 +369,32 @@ if ($mode == 'desc') {
if ($mode == 'feature') { if ($mode == 'feature') {
$text .= '<br><strong>'.$langs->trans("DependsOn").':</strong> '; $text .= '<br><strong>'.$langs->trans("DependsOn").':</strong> ';
if (count($objMod->depends)) { if (is_array($objMod->depends) && count($objMod->depends)) {
$text .= join(',', $objMod->depends); $i = 0;
foreach($objMod->depends as $modulestringorarray) {
if (is_array($modulestringorarray)) {
$text .= ($i ? ', ' : '').join(', ', $modulestringorarray);
} else {
$text .= ($i ? ', ' : '').$modulestringorarray;
}
$i++;
}
} else { } else {
$text .= '<span class="opacitymedium">'.$langs->trans("None").'</span>'; $text .= '<span class="opacitymedium">'.$langs->trans("None").'</span>';
} }
$text .= '<br>';
$text .= '<br><strong>'.$langs->trans("RequiredBy").':</strong> '; $text .= '<br><strong>'.$langs->trans("RequiredBy").':</strong> ';
if (count($objMod->requiredby)) { if (is_array($objMod->requiredby) && count($objMod->requiredby)) {
$text .= join(',', $objMod->requiredby); $i = 0;
foreach($objMod->requiredby as $modulestringorarray) {
if (is_array($modulestringorarray)) {
$text .= ($i ? ', ' : '').join(', ', $modulestringorarray);
} else {
$text .= ($i ? ', ' : '').$modulestringorarray;
}
$i++;
}
} else { } else {
$text .= '<span class="opacitymedium">'.$langs->trans("None").'</span>'; $text .= '<span class="opacitymedium">'.$langs->trans("None").'</span>';
} }

View File

@ -550,7 +550,10 @@ if (is_array($blocks)) {
print '</td>'; print '</td>';
// Link to source object // Link to source object
print '<td'.(preg_match('/<a/', $object_link) ? ' class="nowrap"' : '').'><!-- object_link -->'.$object_link.'</td>'; print '<td class="tdoverflowmax150"'.(preg_match('/<a/', $object_link) ? '' : 'title="'.dol_escape_htmltag(dol_string_nohtmltag($object_link)).'"').'>';
print '<!-- object_link -->'; // $object_link can be a '<a href' link or a text
print $object_link;
print '</td>';
// Amount // Amount
print '<td class="right nowraponall">'.price($block->amounts).'</td>'; print '<td class="right nowraponall">'.price($block->amounts).'</td>';

View File

@ -8767,9 +8767,10 @@ abstract class CommonObject
* @param int $nolink Do not add a href link to view enlarged imaged into a new tab * @param int $nolink Do not add a href link to view enlarged imaged into a new tab
* @param int|string $overwritetitle Do not add title tag on image * @param int|string $overwritetitle Do not add title tag on image
* @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead) * @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead)
* @param string $cache A string if we want to use a cached version of image
* @return string Html code to show photo. Number of photos shown is saved in this->nbphoto * @return string Html code to show photo. Number of photos shown is saved in this->nbphoto
*/ */
public function show_photos($modulepart, $sdir, $size = 0, $nbmax = 0, $nbbyrow = 5, $showfilename = 0, $showaction = 0, $maxHeight = 120, $maxWidth = 160, $nolink = 0, $overwritetitle = 0, $usesharelink = 0) public function show_photos($modulepart, $sdir, $size = 0, $nbmax = 0, $nbbyrow = 5, $showfilename = 0, $showaction = 0, $maxHeight = 120, $maxWidth = 160, $nolink = 0, $overwritetitle = 0, $usesharelink = 0, $cache = '')
{ {
// phpcs:enable // phpcs:enable
global $conf, $user, $langs; global $conf, $user, $langs;
@ -8854,13 +8855,11 @@ abstract class CommonObject
if ($nbphoto % $nbbyrow == 1) { if ($nbphoto % $nbbyrow == 1) {
$return .= '<tr class="center valignmiddle" style="border: 1px">'; $return .= '<tr class="center valignmiddle" style="border: 1px">';
} }
$return .= '<td style="width: '.ceil(100 / $nbbyrow).'%" class="photo">'; $return .= '<td style="width: '.ceil(100 / $nbbyrow).'%" class="photo">'."\n";
} elseif ($nbbyrow < 0) { } elseif ($nbbyrow < 0) {
$return .= '<div class="inline-block">'; $return .= '<div class="inline-block">'."\n";
} }
$return .= "\n";
$relativefile = preg_replace('/^\//', '', $pdir.$photo); $relativefile = preg_replace('/^\//', '', $pdir.$photo);
if (empty($nolink)) { if (empty($nolink)) {
$urladvanced = getAdvancedPreviewUrl($modulepart, $relativefile, 0, 'entity='.$this->entity); $urladvanced = getAdvancedPreviewUrl($modulepart, $relativefile, 0, 'entity='.$this->entity);
@ -8889,10 +8888,10 @@ abstract class CommonObject
if ($val['share']) { if ($val['share']) {
if (empty($maxHeight) || ($photo_vignette && $imgarray['height'] > $maxHeight)) { if (empty($maxHeight) || ($photo_vignette && $imgarray['height'] > $maxHeight)) {
$return .= '<!-- Show original file (thumb not yet available with shared links) -->'; $return .= '<!-- Show original file (thumb not yet available with shared links) -->';
$return .= '<img class="photo photowithmargin'.($addphotorefcss ? ' photoref' : '').'"'.($maxHeight ?' height="'.$maxHeight.'"': '').' src="'.DOL_URL_ROOT.'/viewimage.php?hashp='.urlencode($val['share']).'" title="'.dol_escape_htmltag($alt).'">'; $return .= '<img class="photo photowithmargin'.($addphotorefcss ? ' photoref' : '').'"'.($maxHeight ?' height="'.$maxHeight.'"': '').' src="'.DOL_URL_ROOT.'/viewimage.php?hashp='.urlencode($val['share']).($cache ? '&cache='.urlencode($cache) : '').'" title="'.dol_escape_htmltag($alt).'">';
} else { } else {
$return .= '<!-- Show original file -->'; $return .= '<!-- Show original file -->';
$return .= '<img class="photo photowithmargin'.($addphotorefcss ? ' photoref' : '').'" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?hashp='.urlencode($val['share']).'" title="'.dol_escape_htmltag($alt).'">'; $return .= '<img class="photo photowithmargin'.($addphotorefcss ? ' photoref' : '').'" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?hashp='.urlencode($val['share']).($cache ? '&cache='.urlencode($cache) : '').'" title="'.dol_escape_htmltag($alt).'">';
} }
} else { } else {
$return .= '<!-- Show nophoto file (because file is not shared) -->'; $return .= '<!-- Show nophoto file (because file is not shared) -->';
@ -8901,17 +8900,16 @@ abstract class CommonObject
} else { } else {
if (empty($maxHeight) || ($photo_vignette && $imgarray['height'] > $maxHeight)) { if (empty($maxHeight) || ($photo_vignette && $imgarray['height'] > $maxHeight)) {
$return .= '<!-- Show thumb -->'; $return .= '<!-- Show thumb -->';
$return .= '<img class="photo photowithmargin'.($addphotorefcss ? ' photoref' : '').' maxwidth150onsmartphone maxwidth200"'.($maxHeight ?' height="'.$maxHeight.'"': '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">'; $return .= '<img class="photo photowithmargin'.($addphotorefcss ? ' photoref' : '').' maxwidth150onsmartphone maxwidth200"'.($maxHeight ?' height="'.$maxHeight.'"': '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.($cache ? '&cache='.urlencode($cache) : '').'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">';
} else { } else {
$return .= '<!-- Show original file -->'; $return .= '<!-- Show original file -->';
$return .= '<img class="photo photowithmargin'.($addphotorefcss ? ' photoref' : '').'" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" title="'.dol_escape_htmltag($alt).'">'; $return .= '<img class="photo photowithmargin'.($addphotorefcss ? ' photoref' : '').'" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.($cache ? '&cache='.urlencode($cache) : '').'&file='.urlencode($pdir.$photo).'" title="'.dol_escape_htmltag($alt).'">';
} }
} }
if (empty($nolink)) { if (empty($nolink)) {
$return .= '</a>'; $return .= '</a>';
} }
$return .= "\n";
if ($showfilename) { if ($showfilename) {
$return .= '<br>'.$viewfilename; $return .= '<br>'.$viewfilename;
@ -8940,7 +8938,7 @@ abstract class CommonObject
$return .= '</tr>'; $return .= '</tr>';
} }
} elseif ($nbbyrow < 0) { } elseif ($nbbyrow < 0) {
$return .= '</div>'; $return .= '</div>'."\n";
} }
} }

View File

@ -313,7 +313,7 @@ class Menubase
} }
} else { } else {
dol_syslog(get_class($this)."::create menu entry already exists", LOG_WARNING); dol_syslog(get_class($this)."::create menu entry already exists", LOG_WARNING);
$this->error = 'Error Menu entry already exists'; $this->error = 'Error Menu entry ('.$this->menu_handler.','.$this->position.','.$this->url.') already exists';
return 0; return 0;
} }
} else { } else {

View File

@ -112,7 +112,7 @@ class DoliDBMysqli extends DoliDB
$this->ok = true; $this->ok = true;
// If client is old latin, we force utf8 // If client is old latin, we force utf8
$clientmustbe = empty($conf->db->dolibarr_main_db_character_set) ? 'utf8' : $conf->db->dolibarr_main_db_character_set; $clientmustbe = empty($conf->db->character_set) ? 'utf8' : $conf->db->character_set;
if (preg_match('/latin1/', $clientmustbe)) { if (preg_match('/latin1/', $clientmustbe)) {
$clientmustbe = 'utf8'; $clientmustbe = 'utf8';
} }
@ -142,7 +142,7 @@ class DoliDBMysqli extends DoliDB
if ($this->connected) { if ($this->connected) {
// If client is old latin, we force utf8 // If client is old latin, we force utf8
$clientmustbe = empty($conf->db->dolibarr_main_db_character_set) ? 'utf8' : $conf->db->dolibarr_main_db_character_set; $clientmustbe = empty($conf->db->character_set) ? 'utf8' : $conf->db->character_set;
if (preg_match('/latin1/', $clientmustbe)) { if (preg_match('/latin1/', $clientmustbe)) {
$clientmustbe = 'utf8'; $clientmustbe = 'utf8';
} }

View File

@ -1166,33 +1166,45 @@ function activateModule($value, $withdeps = 1, $noconfverification = 0)
if ($withdeps) { if ($withdeps) {
if (isset($objMod->depends) && is_array($objMod->depends) && !empty($objMod->depends)) { if (isset($objMod->depends) && is_array($objMod->depends) && !empty($objMod->depends)) {
// Activation of modules this module depends on // Activation of modules this module depends on
// this->depends may be array('modModule1', 'mmodModule2') or array('always1'=>"modModule1", 'FR'=>'modModule2') // this->depends may be array('modModule1', 'mmodModule2') or array('always'=>array('modModule1'), 'FR'=>array('modModule2"))
foreach ($objMod->depends as $key => $modulestring) { foreach ($objMod->depends as $key => $modulestringorarray) {
//var_dump((! is_numeric($key)) && ! preg_match('/^always/', $key) && $mysoc->country_code && ! preg_match('/^'.$mysoc->country_code.'/', $key));exit; //var_dump((! is_numeric($key)) && ! preg_match('/^always/', $key) && $mysoc->country_code && ! preg_match('/^'.$mysoc->country_code.'/', $key));exit;
if ((!is_numeric($key)) && !preg_match('/^always/', $key) && $mysoc->country_code && !preg_match('/^'.$mysoc->country_code.'/', $key)) { if ((!is_numeric($key)) && !preg_match('/^always/', $key) && $mysoc->country_code && !preg_match('/^'.$mysoc->country_code.'/', $key)) {
dol_syslog("We are not concerned by dependency with key=".$key." because our country is ".$mysoc->country_code); dol_syslog("We are not concerned by dependency with key=".$key." because our country is ".$mysoc->country_code);
continue; continue;
} }
$activate = false;
foreach ($modulesdir as $dir) { if (!is_array($modulestringorarray)) {
if (file_exists($dir.$modulestring.".class.php")) { $modulestringorarray = array($modulestringorarray);
$resarray = activateModule($modulestring);
if (empty($resarray['errors'])) {
$activate = true;
} else {
foreach ($resarray['errors'] as $errorMessage) {
dol_syslog($errorMessage, LOG_ERR);
}
}
break;
}
} }
if ($activate) { foreach($modulestringorarray as $modulestring) {
$ret['nbmodules'] += $resarray['nbmodules']; $activate = false;
$ret['nbperms'] += $resarray['nbperms']; $activateerr = '';
} else { foreach ($modulesdir as $dir) {
$ret['errors'][] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $modulestring); if (file_exists($dir.$modulestring.".class.php")) {
$resarray = activateModule($modulestring);
if (empty($resarray['errors'])) {
$activate = true;
} else {
$activateerr = join(', ', $resarray['errors']);
foreach ($resarray['errors'] as $errorMessage) {
dol_syslog($errorMessage, LOG_ERR);
}
}
break;
}
}
if ($activate) {
$ret['nbmodules'] += $resarray['nbmodules'];
$ret['nbperms'] += $resarray['nbperms'];
} else {
if ($activateerr) {
$ret['errors'][] = $activateerr;
}
$ret['errors'][] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $modulestring);
}
} }
} }
} }

View File

@ -3,24 +3,27 @@ README (english)
Decription of htdocs/core/login directory Decription of htdocs/core/login directory
--------------------------------------------- ---------------------------------------------
This directory contains files that handle way to validate passwords. This directory contains files that handle the way to validate passwords.
If you want to add a new password checker function, just add a file in If you want to add a new password checker function, just add a file in this directory that follow an example of an already existing files.
this directory that follow example of already existing files.
This file must be called for example : This file must be called for example :
functions_mypasschecker.php functions_mypasschecker.php
Edit function name to call it: Edit the function name to call it:
check_user_mypasschecker check_user_mypasschecker
Change code of this function to return true if couple Change code of this function to return true if couple $usertotest / $passwordtotest is ok for you.
$usertotest / $passwordtotest is ok for you.
Then, you must edit you conf.php file to change the value of Then, you must edit you conf.php file to change the value of
$dolibarr_main_authentication $dolibarr_main_authentication
parameter to set it to : parameter to set it to :
mypasschecker mypasschecker
Once this is done, when you log in to Dolibarr, the function Once this is done, when you log in to Dolibarr, the function
check_user_mypasschecker in this file is called. check_user_mypasschecker in this file is called.
If the function return true and login exists, login is accepted. If the function return true and login exists, login is accepted.
See page https://wiki.dolibarr.org/index.php?title=Authentication,_SSO_and_SSL for more information.

View File

@ -105,9 +105,10 @@ class modBom extends DolibarrModules
// Dependencies // Dependencies
$this->hidden = false; // A condition to hide module $this->hidden = false; // A condition to hide module
$this->depends = array('modProduct'); // List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) // List of module class names as string that must be enabled if this module is enabled. Example: array('always'=>array('modModuleToEnable1','modModuleToEnable2'), 'FR'=>array('modModuleToEnableFR'...))
$this->requiredby = array('modMrp'); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->depends = array('modProduct');
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->requiredby = array('modMrp');
$this->conflictwith = array();
$this->langfiles = array("mrp"); $this->langfiles = array("mrp");
//$this->phpmin = array(7, 0)); // Minimum version of PHP required by module //$this->phpmin = array(7, 0)); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(9, 0); // Minimum version of Dolibarr required by module $this->need_dolibarr_version = array(9, 0); // Minimum version of Dolibarr required by module

View File

@ -129,7 +129,7 @@ class modBookCal extends DolibarrModules
// Dependencies // Dependencies
// A condition to hide module // A condition to hide module
$this->hidden = false; $this->hidden = false;
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) // List of module class names as string that must be enabled if this module is enabled. Example: array('always'=>array('modModuleToEnable1','modModuleToEnable2'), 'FR'=>array('modModuleToEnableFR'...))
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)

View File

@ -114,7 +114,7 @@ class modEventOrganization extends DolibarrModules
// Dependencies // Dependencies
// A condition to hide module // A condition to hide module
$this->hidden = false; $this->hidden = false;
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) // List of module class names as string that must be enabled if this module is enabled. Example: array('always'=>array('modModuleToEnable1','modModuleToEnable2'), 'FR'=>array('modModuleToEnableFR'...))
$this->depends = array('modProjet','modCategorie'); $this->depends = array('modProjet','modCategorie');
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)

View File

@ -131,7 +131,7 @@ class modKnowledgeManagement extends DolibarrModules
// Dependencies // Dependencies
// A condition to hide module // A condition to hide module
$this->hidden = false; $this->hidden = false;
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) // List of module class names as string that must be enabled if this module is enabled. Example: array('always'=>array('modModuleToEnable1','modModuleToEnable2'), 'FR'=>array('modModuleToEnableFR'...))
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)

View File

@ -117,7 +117,7 @@ class modMrp extends DolibarrModules
// Dependencies // Dependencies
// A condition to hide module // A condition to hide module
$this->hidden = false; $this->hidden = false;
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) // List of module class names as string that must be enabled if this module is enabled. Example: array('always'=>array('modModuleToEnable1','modModuleToEnable2'), 'FR'=>array('modModuleToEnableFR'...))
$this->depends = array('modBom'); $this->depends = array('modBom');
$this->requiredby = array('modWorkstation'); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->requiredby = array('modWorkstation'); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)

View File

@ -138,7 +138,7 @@ class modPartnership extends DolibarrModules
// Dependencies // Dependencies
// A condition to hide module // A condition to hide module
$this->hidden = false; $this->hidden = false;
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) // List of module class names as string that must be enabled if this module is enabled. Example: array('always'=>array('modModuleToEnable1','modModuleToEnable2'), 'FR'=>array('modModuleToEnableFR'...))
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)

View File

@ -72,7 +72,7 @@ class modPaypal extends DolibarrModules
// Dependencies // Dependencies
$this->hidden = false; // A condition to hide module $this->hidden = false; // A condition to hide module
$this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
$this->requiredby = array('modPaypalPlus'); // List of module ids to disable if this one is disabled $this->requiredby = array(); // List of module ids to disable if this one is disabled
$this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->conflictwith = array(); // List of module class names as string this module is in conflict with
$this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->phpmin = array(7, 0); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module

View File

@ -117,7 +117,7 @@ class modRecruitment extends DolibarrModules
// Dependencies // Dependencies
// A condition to hide module // A condition to hide module
$this->hidden = false; $this->hidden = false;
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) // List of module class names as string that must be enabled if this module is enabled. Example: array('always'=>array('modModuleToEnable1','modModuleToEnable2'), 'FR'=>array('modModuleToEnableFR'...))
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)

View File

@ -119,7 +119,7 @@ class modStockTransfer extends DolibarrModules
// Dependencies // Dependencies
// A condition to hide module // A condition to hide module
$this->hidden = false; $this->hidden = false;
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) // List of module class names as string that must be enabled if this module is enabled. Example: array('always'=>array('modModuleToEnable1','modModuleToEnable2'), 'FR'=>array('modModuleToEnableFR'...))
$this->depends = array('modStock', 'modProduct'); $this->depends = array('modStock', 'modProduct');
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)

View File

@ -98,7 +98,8 @@ class modTakePos extends DolibarrModules
// Dependencies // Dependencies
$this->hidden = false; // A condition to hide module $this->hidden = false; // A condition to hide module
$this->depends = array('always1'=>"modBanque", 'always2'=>"modFacture", 'always3'=>"modProduct", 'always4'=>'modCategorie', 'FR1'=>'modBlockedLog'); // List of module class names as string that must be enabled if this module is enabled // List of module class names as string that must be enabled if this module is enabled. Example: array('always'=>array('modModuleToEnable1','modModuleToEnable2'), 'FR'=>array('modModuleToEnableFR'...))
$this->depends = array('always'=>array("modBanque", "modFacture", "modProduct", "modCategorie"), 'FR'=>array('modBlockedLog'));
$this->requiredby = array(); // List of module ids to disable if this one is disabled $this->requiredby = array(); // List of module ids to disable if this one is disabled
$this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->conflictwith = array(); // List of module class names as string this module is in conflict with
$this->langfiles = array("cashdesk"); $this->langfiles = array("cashdesk");

View File

@ -130,7 +130,7 @@ class modWebhook extends DolibarrModules
// Dependencies // Dependencies
// A condition to hide module // A condition to hide module
$this->hidden = false; $this->hidden = false;
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) // List of module class names as string that must be enabled if this module is enabled. Example: array('always'=>array('modModuleToEnable1','modModuleToEnable2'), 'FR'=>array('modModuleToEnableFR'...))
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)

View File

@ -119,7 +119,7 @@ class modWorkstation extends DolibarrModules
// Dependencies // Dependencies
// A condition to hide module // A condition to hide module
$this->hidden = false; $this->hidden = false;
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) // List of module class names as string that must be enabled if this module is enabled. Example: array('always'=>array('modModuleToEnable1','modModuleToEnable2'), 'FR'=>array('modModuleToEnableFR'...))
$this->depends = array('modMrp'); $this->depends = array('modMrp');
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)

View File

@ -117,7 +117,7 @@ class modZapier extends DolibarrModules
// Dependencies // Dependencies
// A condition to hide module // A condition to hide module
$this->hidden = false; $this->hidden = false;
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) // List of module class names as string that must be enabled if this module is enabled. Example: array('always'=>array('modModuleToEnable1','modModuleToEnable2'), 'FR'=>array('modModuleToEnableFR'...))
$this->depends = array('modApi'); $this->depends = array('modApi');
// List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->requiredby = array(); $this->requiredby = array();

View File

@ -89,6 +89,8 @@ $permissiontocreatedir = $user->hasRight('ecm', 'setup');
$permissiontodelete = $user->hasRight('ecm', 'upload'); $permissiontodelete = $user->hasRight('ecm', 'upload');
$permissiontodeletedir = $user->hasRight('ecm', 'setup'); $permissiontodeletedir = $user->hasRight('ecm', 'setup');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('ecmindexcard', 'globalcard'));
/* /*
* Actions * Actions

View File

@ -102,6 +102,8 @@ $websitekey = '';
$permissiontoadd = $permissiontouploadfile; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles $permissiontoadd = $permissiontouploadfile; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('ecmmediascard', 'globalcard'));
/* /*
* Actions * Actions

View File

@ -135,10 +135,12 @@ class modMyModule extends DolibarrModules
// Dependencies // Dependencies
// A condition to hide module // A condition to hide module
$this->hidden = false; $this->hidden = false;
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) // List of module class names that must be enabled if this module is enabled. Example: array('always'=>array('modModuleToEnable1','modModuleToEnable2'), 'FR'=>array('modModuleToEnableFR')...)
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) // List of module class names to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->requiredby = array();
// List of module class names this module is in conflict with. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array();
// The language file dedicated to your module // The language file dedicated to your module
$this->langfiles = array("mymodule@mymodule"); $this->langfiles = array("mymodule@mymodule");

View File

@ -5032,10 +5032,9 @@ class Product extends CommonObject
} }
if (!empty($this->entity)) { if (!empty($this->entity)) {
$tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80); $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, 1);
if ($this->nbphoto > 0) { if ($this->nbphoto > 0) {
$datas['photo'] = '<div class="photointooltip floatright">' . $tmpphoto . '</div>'; $datas['photo'] = '<div class="photointooltip floatright">'."\n" . $tmpphoto . '</div>';
//$label .= '<div style="clear: both;"></div>';
} }
} }
@ -5172,9 +5171,9 @@ class Product extends CommonObject
if (empty($notooltip)) { if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$label = $langs->trans("ShowProduct"); $label = $langs->trans("ShowProduct");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' alt="'.dol_escape_htmltag($label, 1, 1).'"';
} }
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1, 1).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="nowraponall '.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; $linkclose .= $dataparams.' class="nowraponall '.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else { } else {
$linkclose = ' class="nowraponall'.($morecss ? ' '.$morecss : '').'"'; $linkclose = ' class="nowraponall'.($morecss ? ' '.$morecss : '').'"';

View File

@ -2380,12 +2380,8 @@ class Task extends CommonObjectLine
if (property_exists($this, 'budget_amount')) { if (property_exists($this, 'budget_amount')) {
//$return .= '<br><span class="info-box-label amount">'.$langs->trans("Budget").' : '.price($this->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>'; //$return .= '<br><span class="info-box-label amount">'.$langs->trans("Budget").' : '.price($this->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>';
} }
if (property_exists($this, 'fk_statut')) {
$return .= '<br><span class="info-box-status ">'.$this->fk_statut.'</span>';
//$return .= ' <span class="info-box-label amount">'.$this->progress.'%</span>';
}
if (property_exists($this, 'duration_effective')) { if (property_exists($this, 'duration_effective')) {
$return .= '<div class="info-box-label progressinkanban">'.getTaskProgressView($this, false, true).'</div>'; $return .= '<br><br><div class="info-box-label progressinkanban">'.getTaskProgressView($this, false, true).'</div>';
} }
$return .= '</div>'; $return .= '</div>';
$return .= '</div>'; $return .= '</div>';

View File

@ -412,10 +412,9 @@ if ($resql) {
dol_print_error($db); dol_print_error($db);
} }
if (empty($conf->global->PROJECT_HIDE_PROJECT_LIST_ON_PROJECT_AREA)) { if (!getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') || getDolGlobalInt('PROJECT_SHOW_OPEN_PROJECTS_LIST_ON_PROJECT_AREA')) {
// This list can be very long, so we allow to hide it to prefer to use the list page. // This list is surely very long and useless when we are using opportunities, so we hide it for this use case, but we allow to show it if
// Add constant PROJECT_HIDE_PROJECT_LIST_ON_PROJECT_AREA to hide this list // we really want it and to allow interface backward compatibility.
print '<br>'; print '<br>';
print_projecttasks_array($db, $form, $socid, $projectsListId, 0, 1, $listofoppstatus, array()); print_projecttasks_array($db, $form, $socid, $projectsListId, 0, 1, $listofoppstatus, array());

View File

@ -425,7 +425,7 @@ if (count($listofprojectcontacttypeexternal) == 0) {
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$distinct = 'DISTINCT'; // We add distinct until we have added a protection to be sure a contact of a project and task is only once. $distinct = 'DISTINCT'; // We add distinct until filter on contact of project or task is implemented with AND EXISTS
$sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat,"; $sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat,";
$sql .= " p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount,"; $sql .= " p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount,";
$sql .= " p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event,"; $sql .= " p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event,";
@ -1028,7 +1028,7 @@ if (!empty($moreforfilter)) {
} }
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $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 = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
@ -1253,7 +1253,7 @@ $totalarray['nbfield'] = 0;
// -------------------------------------------------------------------- // --------------------------------------------------------------------
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
if (!empty($arrayfields['p.ref']['checked'])) { if (!empty($arrayfields['p.ref']['checked'])) {
@ -1376,7 +1376,7 @@ if (!empty($arrayfields['p.fk_statut']['checked'])) {
} }
// Action column // Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
print '</tr>'."\n"; print '</tr>'."\n";
@ -1409,7 +1409,7 @@ while ($i < $imaxinloop) {
$object->opp_percent = $obj->opp_percent; $object->opp_percent = $obj->opp_percent;
$object->opp_status = $obj->fk_opp_status; $object->opp_status = $obj->fk_opp_status;
$object->opp_status_code = $obj->opp_status_code; $object->opp_status_code = $obj->opp_status_code;
$object->opp_amount = !empty($obj->opp_ammount) ? $obj->opp_ammount : ""; $object->opp_amount = !empty($obj->opp_amount) ? $obj->opp_amount : "";
$object->opp_weighted_amount = $obj->opp_weighted_amount; $object->opp_weighted_amount = $obj->opp_weighted_amount;
$object->budget_amount = $obj->budget_amount; $object->budget_amount = $obj->budget_amount;
$object->usage_opportunity = $obj->usage_opportunity; $object->usage_opportunity = $obj->usage_opportunity;

View File

@ -162,8 +162,8 @@ $arrayfields = array(
't.datee'=>array('label'=>"Deadline", 'checked'=>1, 'position'=>101), 't.datee'=>array('label'=>"Deadline", 'checked'=>1, 'position'=>101),
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1), 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1),
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0), 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>0), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>0, 'csslist'=>'tdoverflowmax125'),
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1, 'csslist'=>'tdoverflowmax125'),
'p.fk_statut'=>array('label'=>"ProjectStatus", 'checked'=>1), 'p.fk_statut'=>array('label'=>"ProjectStatus", 'checked'=>1),
't.planned_workload'=>array('label'=>"PlannedWorkload", 'checked'=>1, 'position'=>102), 't.planned_workload'=>array('label'=>"PlannedWorkload", 'checked'=>1, 'position'=>102),
't.duration_effective'=>array('label'=>"TimeSpent", 'checked'=>1, 'position'=>103), 't.duration_effective'=>array('label'=>"TimeSpent", 'checked'=>1, 'position'=>103),
@ -1166,7 +1166,7 @@ while ($i < $imaxinloop) {
} }
} }
$object->fk_statut = $projectstatic->getLibStatut(1); $arraydata = array();
$arraydata['projectlink'] = $projectstatic->getNomUrl(1); $arraydata['projectlink'] = $projectstatic->getNomUrl(1);
print $object->getKanbanView('', $arraydata); print $object->getKanbanView('', $arraydata);
if ($i == ($imaxinloop - 1)) { if ($i == ($imaxinloop - 1)) {
@ -1278,8 +1278,8 @@ while ($i < $imaxinloop) {
} }
// Project title // Project title
if (!empty($arrayfields['p.title']['checked'])) { if (!empty($arrayfields['p.title']['checked'])) {
print '<td>'; print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->projecttitle).'">';
print dol_trunc($obj->projecttitle, 80); print dol_escape_htmltag($obj->projecttitle);
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
@ -1287,7 +1287,7 @@ while ($i < $imaxinloop) {
} }
// Third party // Third party
if (!empty($arrayfields['s.nom']['checked'])) { if (!empty($arrayfields['s.nom']['checked'])) {
print '<td>'; print '<td class="tdoverflowmax125">';
if ($obj->socid) { if ($obj->socid) {
print $socstatic->getNomUrl(1, '', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); print $socstatic->getNomUrl(1, '', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
} else { } else {
@ -1300,7 +1300,7 @@ while ($i < $imaxinloop) {
} }
// Alias // Alias
if (!empty($arrayfields['s.name_alias']['checked'])) { if (!empty($arrayfields['s.name_alias']['checked'])) {
print '<td>'; print '<td class="tdoverflowmax125">';
if ($obj->socid) { if ($obj->socid) {
print $socstatic->name_alias; print $socstatic->name_alias;
} else { } else {

View File

@ -121,7 +121,8 @@ if (preg_match('/PM=([^\.]+)/', $FULLTAG, $reg)) {
$paymentmethod = $reg[1]; $paymentmethod = $reg[1];
} }
if (empty($paymentmethod)) { if (empty($paymentmethod)) {
dol_print_error(null, 'The back url does not contains a parameter fulltag that should help us to find the payment method used'); dol_syslog("***** paymentok.php was called with a non valid parameter FULLTAG=".$FULLTAG, LOG_DEBUG, 0, '_payment');
dol_print_error(null, 'The callback url does not contains a parameter fulltag that should help us to find the payment method used');
exit; exit;
} }
@ -250,7 +251,7 @@ print '<br><br><br>';
if (isModEnabled('paypal')) { if (isModEnabled('paypal')) {
if ($paymentmethod == 'paypal') { // We call this page only if payment is ok on payment system if ($paymentmethod === 'paypal') { // We call this page only if payment is ok on payment system
if ($PAYPALTOKEN) { if ($PAYPALTOKEN) {
// Get on url call // Get on url call
$onlinetoken = $PAYPALTOKEN; $onlinetoken = $PAYPALTOKEN;
@ -330,14 +331,14 @@ if (isModEnabled('paypal')) {
} }
if (isModEnabled('paybox')) { if (isModEnabled('paybox')) {
if ($paymentmethod == 'paybox') { if ($paymentmethod === 'paybox') {
// TODO Add a check to validate that payment is ok. // TODO Add a check to validate that payment is ok.
$ispaymentok = true; // We call this page only if payment is ok on payment system $ispaymentok = true; // We call this page only if payment is ok on payment system
} }
} }
if (isModEnabled('stripe')) { if (isModEnabled('stripe')) {
if ($paymentmethod == 'stripe') { if ($paymentmethod === 'stripe') {
// TODO Add a check to validate that payment is ok. We can request Stripe with payment_intent and payment_intent_client_secret // TODO Add a check to validate that payment is ok. We can request Stripe with payment_intent and payment_intent_client_secret
$ispaymentok = true; // We call this page only if payment is ok on payment system $ispaymentok = true; // We call this page only if payment is ok on payment system
} }
@ -350,11 +351,14 @@ $parameters = [
]; ];
$reshook = $hookmanager->executeHooks('isPaymentOK', $parameters, $object, $action); $reshook = $hookmanager->executeHooks('isPaymentOK', $parameters, $object, $action);
if ($reshook >= 0) { if ($reshook >= 0) {
$ispaymentok = $hookmanager->resArray['ispaymentok']; if (isset($hookmanager->resArray['ispaymentok'])) {
dol_syslog('ispaymentok overwrite by hook return with value='.$hookmanager->resArray['ispaymentok'], LOG_DEBUG, 0, '_payment');
$ispaymentok = $hookmanager->resArray['ispaymentok'];
}
} }
// If data not provided from back url, search them into the session env // If data not provided into callback url, search them into the session env
if (empty($ipaddress)) { if (empty($ipaddress)) {
$ipaddress = $_SESSION['ipaddress']; $ipaddress = $_SESSION['ipaddress'];
} }
@ -814,13 +818,13 @@ if ($ispaymentok) {
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
$paymentTypeId = 0; $paymentTypeId = 0;
if ($paymentmethod == 'paybox') { if ($paymentmethod === 'paybox') {
$paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS;
} }
if ($paymentmethod == 'paypal') { if ($paymentmethod === 'paypal') {
$paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS;
} }
if ($paymentmethod == 'stripe') { if ($paymentmethod === 'stripe') {
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
} }
if (empty($paymentTypeId)) { if (empty($paymentTypeId)) {

View File

@ -269,12 +269,7 @@ if ($showbarcode) {
} }
// Me // Me section
// Show photo
if ($urllogo) {
print '<img class="userphotopublicvcard" id="dolpaymentlogo" src="'.$urllogofull.'">';
}
$usersection = ''; $usersection = '';
@ -325,6 +320,11 @@ if (!empty($object->socialnetworks) && is_array($object->socialnetworks) && coun
} }
if ($usersection) { if ($usersection) {
// Show photo
if ($urllogo) {
print '<img class="userphotopublicvcard" id="dolpaymentlogo" src="'.$urllogofull.'">';
}
print '<table id="dolpaymenttable" summary="Job position offer" class="center">'."\n"; print '<table id="dolpaymenttable" summary="Job position offer" class="center">'."\n";
// Output payment summary form // Output payment summary form
@ -340,6 +340,11 @@ if ($usersection) {
print '</td></tr>'."\n"; print '</td></tr>'."\n";
print '</table>'."\n"; print '</table>'."\n";
} else {
// Show photo
if ($urllogo) {
print '<br><center><img class="userphotopublicvcard" style="position: unset !important;" id="dolpaymentlogo" src="'.$urllogofull.'"></center>';
}
} }

View File

@ -153,8 +153,8 @@ if ($modulepart == 'fckeditor') {
*/ */
if (GETPOST("cache", 'alpha')) { if (GETPOST("cache", 'alpha')) {
// Important: Following code is to avoid page request by browser and PHP CPU at // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
// each Dolibarr page access. // Add param cache=abcdef
if (empty($dolibarr_nocache)) { if (empty($dolibarr_nocache)) {
header('Cache-Control: max-age=3600, public, must-revalidate'); header('Cache-Control: max-age=3600, public, must-revalidate');
header('Pragma: cache'); // This is to avoid having Pragma: no-cache header('Pragma: cache'); // This is to avoid having Pragma: no-cache