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

This commit is contained in:
Frédéric FRANCE 2021-11-28 21:14:12 +01:00
commit 308998e21c
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
110 changed files with 711 additions and 419 deletions

1
.gitignore vendored
View File

@ -55,3 +55,4 @@ yarn.lock
package-lock.json package-lock.json
doc/install.lock doc/install.lock
/factory/

View File

@ -105,6 +105,7 @@ NEW: Use an ajax call for the clicktodial feature instead of href link.
NEW: when multiple order linked to facture, show list into note. NEW: when multiple order linked to facture, show list into note.
NEW: when we delete several objects with massaction, if somes object has child we must see which objects are concerned and nevertheless delete objects which can be deleted NEW: when we delete several objects with massaction, if somes object has child we must see which objects are concerned and nevertheless delete objects which can be deleted
NEW: Editing a page in website module keep old page with name .back NEW: Editing a page in website module keep old page with name .back
NEW: External backups can be downloaded from the "About info page".
For developers: For developers:
@ -140,6 +141,8 @@ Following changes may create regressions for some external modules, but were nec
* The method static ActionComm::getActions($db, ...) is no more static. Use $actioncomm->getActions(...) instead (without $db param). * The method static ActionComm::getActions($db, ...) is no more static. Use $actioncomm->getActions(...) instead (without $db param).
* The 'action=delete&file=...' has been replaced with 'action=deletefile&file=...' to avoid confusion with deletion of object lines. * The 'action=delete&file=...' has been replaced with 'action=deletefile&file=...' to avoid confusion with deletion of object lines.
* Method getDictvalue has been renamed into getDictionaryValue to match camel case rule. * Method getDictvalue has been renamed into getDictionaryValue to match camel case rule.
* To execute shell or command line command, your code must never use method like exec, shell_exec, popen, .. but must use the built-in
method executeCLI() available into core/class/utils.class.php
@ -614,7 +617,8 @@ Following changes may create regressions for some external modules, but were nec
* Removed deprecated substitution key __REFCLIENT__ (replaced with __REF_CLIENT__) * Removed deprecated substitution key __REFCLIENT__ (replaced with __REF_CLIENT__)
* Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries. * Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries.
* v14 seems to work correctly on PHP v8 but it generates a lot of verbose warnings. Currently, v14 i snot yet officialy supported with PHP 8. * v14 seems to work correctly on PHP v8 but it generates a lot of verbose warnings. Currently, v14 i snot yet officialy supported with PHP 8.
* To execute shell or command line command, your code must never use method like exec, shell_exec, popen, .. but must use the built-in
method executeCLI() available into core/class/utils.class.php
***** ChangeLog for 13.0.5 compared to 13.0.4 ***** ***** ChangeLog for 13.0.5 compared to 13.0.4 *****

View File

@ -1398,6 +1398,7 @@ class Adherent extends CommonObject
$this->photo = $obj->photo; $this->photo = $obj->photo;
$this->statut = $obj->statut; $this->statut = $obj->statut;
$this->status = $obj->statut;
$this->public = $obj->public; $this->public = $obj->public;
$this->datec = $this->db->jdate($obj->datec); $this->datec = $this->db->jdate($obj->datec);

View File

@ -543,14 +543,13 @@ class AdherentType extends CommonObject
} }
/** /**
* Return list of amount by type id * Return the array of all amounts per membership type id
* *
* @param int $status Filter on status of type * @param int $status Filter on status of type
* @return array List of types of members * @return array Array of membership type
*/ */
public function amountByType($status = null) public function amountByType($status = null)
{ {
global $conf, $langs; global $conf, $langs;
$amountbytype = array(); $amountbytype = array();
@ -578,6 +577,7 @@ class AdherentType extends CommonObject
} else { } else {
print $this->db->error(); print $this->db->error();
} }
return $amountbytype; return $amountbytype;
} }

View File

@ -284,7 +284,8 @@ class Dolistore
$download_link .= '<br><br><a target="_blank" rel="noopener noreferrer" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>'; $download_link .= '<br><br><a target="_blank" rel="noopener noreferrer" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
} }
//checking versions // Set and check version
$version = '';
if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) { if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) {
if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) { if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) {
//compatible //compatible
@ -317,14 +318,21 @@ class Dolistore
} }
//output template //output template
$html .= '<tr class="app oddeven '.dol_escape_htmltag($compatible).'"> $html .= '<tr class="app oddeven '.dol_escape_htmltag($compatible).'">';
<td class="center" width="210"><div class="newAppParent">'.dol_escape_htmltag($newapp.$images).'</div></td> $html .= '<td class="center" width="210"><div class="newAppParent">';
<td class="margeCote"><h2 class="appTitle">'.dol_escape_htmltag($product->name->language[$this->lang - 1]) $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html
.'<br><small>'.dol_escape_htmltag($version).'</small></h2> $html .= '</div></td>';
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).'</small><br><br>'.dol_escape_htmltag($product->description_short->language[$this->lang - 1]).'</td>'; $html .= '<td class="margeCote"><h2 class="appTitle">';
$html .= dol_escape_htmltag($product->name->language[$this->lang - 1]);
$html .= '<br><small>';
$html .= $version; // No dol_escape_htmltag, it is already escape html
$html .= '</small></h2>';
$html .= '<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).'</small><br><br>'.dol_escape_htmltag($product->description_short->language[$this->lang - 1]).'</td>';
// do not load if display none // do not load if display none
//$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>'; //$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>';
$html .= '<td class="margeCote center">'.dol_escape_htmltag($price).'</td>'; $html .= '<td class="margeCote center">';
$html .= $price;
$html .= '</td>';
$html .= '<td class="margeCote">'.$download_link.'</td>'; $html .= '<td class="margeCote">'.$download_link.'</td>';
$html .= '</tr>'; $html .= '</tr>';
} }

View File

@ -469,13 +469,17 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print load_fiche_titre($langs->trans('OtherOptions'), '', ''); print load_fiche_titre($langs->trans('OtherOptions'), '', '');
if (empty($conf->global->HRM_MAXRANK)) {
$conf->global->HRM_MAXRANK = Skill::DEFAULT_MAX_RANK_PER_SKILL;
}
if ($action == 'edit') { if ($action == 'edit') {
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) { foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) { if ($val['enabled']==1) {
@ -571,7 +575,7 @@ if ($action == 'edit') {
} else { } else {
if (!empty($arrayofparameters)) { if (!empty($arrayofparameters)) {
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) { foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) { if ($val['enabled']==1) {

View File

@ -326,6 +326,13 @@ if ($mode == 'desc') {
$textexternal = ''; $textexternal = '';
if ($objMod->isCoreOrExternalModule() == 'external') { if ($objMod->isCoreOrExternalModule() == 'external') {
$textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Origin").':</span> '.$langs->trans("ExternalModule").' - '.$langs->trans("InstalledInto", $dirofmodule); $textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Origin").':</span> '.$langs->trans("ExternalModule").' - '.$langs->trans("InstalledInto", $dirofmodule);
global $dolibarr_allow_download_external_modules;
if (!empty($dolibarr_allow_download_external_modules) && preg_match('/\/custom\//', $dirofmodule)) {
// Add a link to download a zip of the module
$textexternal .= ' <a href="'.DOL_URL_ROOT.'/admin/tools/export_files.php?export_type=externalmodule&what='.urlencode($moduledir).'&compression=zip&zipfilename_template=module_'.$moduledir.'-'.$version.'.notorig" target="_blank" rel="noopener">'.img_picto('', 'download').'</a>';
}
if ($objMod->editor_name != 'dolibarr') { if ($objMod->editor_name != 'dolibarr') {
$textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Publisher").':</span> '.(empty($objMod->editor_name) ? $langs->trans("Unknown") : $objMod->editor_name); $textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Publisher").':</span> '.(empty($objMod->editor_name) ? $langs->trans("Unknown") : $objMod->editor_name);
} }

View File

@ -303,7 +303,7 @@ llxHeader('', $langs->trans("Setup"), $help_url, '', '', '', $morejs, $morecss,
// Search modules dirs // Search modules dirs
$modulesdir = dolGetModulesDirs(); $modulesdir = dolGetModulesDirs();
$arrayofnatures = array('core'=>$langs->transnoentitiesnoconv("Core"), 'external'=>$langs->transnoentitiesnoconv("External").' - ['.$langs->trans("AllPublishers").']'); $arrayofnatures = array('core'=>$langs->transnoentitiesnoconv("NativeModules"), 'external'=>$langs->transnoentitiesnoconv("External").' - ['.$langs->trans("AllPublishers").']');
$arrayofwarnings = array(); // Array of warning each module want to show when activated $arrayofwarnings = array(); // Array of warning each module want to show when activated
$arrayofwarningsext = array(); // Array of warning each module want to show when we activate an external module $arrayofwarningsext = array(); // Array of warning each module want to show when we activate an external module
$filename = array(); $filename = array();
@ -526,7 +526,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
$moreforfilter = '<div class="valignmiddle">'; $moreforfilter = '<div class="valignmiddle">';
$moreforfilter .= '<div class="floatright right pagination --module-list"><ul><li>'; $moreforfilter .= '<div class="floatright right pagination paddingtop --module-list"><ul><li>';
$moreforfilter .= dolGetButtonTitle($langs->trans('CheckForModuleUpdate'), $langs->trans('CheckForModuleUpdate').'<br>'.$langs->trans('CheckForModuleUpdateHelp'), 'fa fa-sync', $_SERVER["PHP_SELF"].'?action=checklastversion&token='.newToken().'&mode='.$mode.$param, '', 1, array('morecss'=>'reposition')); $moreforfilter .= dolGetButtonTitle($langs->trans('CheckForModuleUpdate'), $langs->trans('CheckForModuleUpdate').'<br>'.$langs->trans('CheckForModuleUpdateHelp'), 'fa fa-sync', $_SERVER["PHP_SELF"].'?action=checklastversion&token='.newToken().'&mode='.$mode.$param, '', 1, array('morecss'=>'reposition'));
$moreforfilter .= dolGetButtonTitleSeparator(); $moreforfilter .= dolGetButtonTitleSeparator();
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', ($mode == 'commonkanban' ? 2 : 1), array('morecss'=>'reposition')); $moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', ($mode == 'commonkanban' ? 2 : 1), array('morecss'=>'reposition'));
@ -563,8 +563,10 @@ if ($mode == 'common' || $mode == 'commonkanban') {
$moreforfilter .= ' '; $moreforfilter .= ' ';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<input type="submit" name="buttonsubmit" class="button" value="'.dol_escape_htmltag($langs->trans("Refresh")).'">'; $moreforfilter .= '<input type="submit" name="buttonsubmit" class="button" value="'.dol_escape_htmltag($langs->trans("Refresh")).'">';
if ($search_keyword || $search_status || $search_nature || $search_version) {
$moreforfilter .= ' '; $moreforfilter .= ' ';
$moreforfilter .= '<input type="submit" name="buttonreset" class="butActionDelete noborderbottom" value="'.dol_escape_htmltag($langs->trans("Reset")).'">'; $moreforfilter .= '<input type="submit" name="buttonreset" class="buttonreset noborderbottom" value="'.dol_escape_htmltag($langs->trans("Reset")).'">';
}
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
@ -597,6 +599,9 @@ if ($mode == 'common' || $mode == 'commonkanban') {
$oldfamily = ''; $oldfamily = '';
$foundoneexternalmodulewithupdate = 0; $foundoneexternalmodulewithupdate = 0;
$linenum = 0; $linenum = 0;
$atleastonequalified = 0;
$atleastoneforfamily = 0;
foreach ($orders as $key => $value) { foreach ($orders as $key => $value) {
$linenum++; $linenum++;
$tab = explode('_', $value); $tab = explode('_', $value);
@ -685,7 +690,9 @@ if ($mode == 'common' || $mode == 'commonkanban') {
} }
} }
// Load all lang files of module $atleastonequalified++;
// Load all language files of the qualified module
if (isset($objMod->langfiles) && is_array($objMod->langfiles)) { if (isset($objMod->langfiles) && is_array($objMod->langfiles)) {
foreach ($objMod->langfiles as $domain) { foreach ($objMod->langfiles as $domain) {
$langs->load($domain); $langs->load($domain);
@ -972,6 +979,10 @@ if ($mode == 'common' || $mode == 'commonkanban') {
} }
} }
if (!$atleastonequalified) {
print '<br><span class="opacitymedium">'.$langs->trans("NoDeployedModulesFoundWithThisSearchCriteria").'</span><br><br>';
}
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<br>'; print '<br>';
@ -1051,7 +1062,9 @@ if ($mode == 'marketplace') {
<div id="category-tree-left"> <div id="category-tree-left">
<ul class="tree"> <ul class="tree">
<?php echo dol_escape_htmltag($dolistore->get_categories()); ?> <?php
echo $dolistore->get_categories(); // Do not use dol_escape_htmltag here, it is already a structured content
?>
</ul> </ul>
</div> </div>
<div id="listing-content"> <div id="listing-content">

View File

@ -88,9 +88,9 @@ if (function_exists('exec')) {
} }
print '<br>'; print '<br>';
print "<strong>PHP session.use_strict_mode</strong> = ".(ini_get('session.use_strict_mode') ? ini_get('session.use_strict_mode') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n"; print "<strong>PHP session.use_strict_mode</strong> = ".(ini_get('session.use_strict_mode') ? '' : img_warning().' ').(ini_get('session.use_strict_mode') ? ini_get('session.use_strict_mode') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.use_only_cookies</strong> = ".(ini_get('session.use_only_cookies') ? ini_get('session.use_only_cookies') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n"; print "<strong>PHP session.use_only_cookies</strong> = ".(ini_get('session.use_only_cookies') ? '' : img_warning().' ').(ini_get('session.use_only_cookies') ? ini_get('session.use_only_cookies') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.cookie_httponly</strong> = ".(ini_get('session.cookie_httponly') ? ini_get('session.cookie_httponly') : '').' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n"; print "<strong>PHP session.cookie_httponly</strong> = ".(ini_get('session.cookie_httponly') ? '' : img_warning().' ').(ini_get('session.cookie_httponly') ? ini_get('session.cookie_httponly') : '').' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? ini_get('session.cookie_samesite') : 'None'); print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? ini_get('session.cookie_samesite') : 'None');
if (!ini_get('session.cookie_samesite') || ini_get('session.cookie_samesite') == 'Lax') { if (!ini_get('session.cookie_samesite') || ini_get('session.cookie_samesite') == 'Lax') {
print ' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Lax').")</span>"; print ' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Lax').")</span>";

View File

@ -70,9 +70,14 @@ if ($labeluser && $labelgroup) {
if (function_exists('exec')) { if (function_exists('exec')) {
$arrayout = array(); $varout = 0; $arrayout = array(); $varout = 0;
exec('id', $arrayout, $varout); exec('id', $arrayout, $varout);
print '<tr><td>'.$langs->trans("WebUserGroup")." (real, 'id' command)</td><td>";
if (empty($varout)) { // Test command is ok. Work only on Linux OS. if (empty($varout)) { // Test command is ok. Work only on Linux OS.
print '<tr><td>'.$langs->trans("WebUserGroup")." (real, 'id' command)</td><td>".join(',', $arrayout)."</td></tr>\n"; print join(',', $arrayout);
} else {
$langs->load("errors");
print '<span class="opacitymedium">'.$langs->trans("ErrorExecIdFailed").'</span>';
} }
print "</td></tr>\n";
} }
print '</table>'; print '</table>';
print '</div>'; print '</div>';

View File

@ -145,6 +145,8 @@ print "<!-- Dump of a server -->\n";
print '<form method="post" action="export.php" name="dump">'; print '<form method="post" action="export.php" name="dump">';
print '<input type="hidden" name="token" value="'.newToken().'" />'; print '<input type="hidden" name="token" value="'.newToken().'" />';
print '<input type="hidden" name="export_type" value="server" />'; print '<input type="hidden" name="export_type" value="server" />';
print '<input type="hidden" name="page_y" value="" />';
print '<fieldset id="fieldsetexport"><legend class="legendforfieldsetstep" style="font-size: 3em">1</legend>'; print '<fieldset id="fieldsetexport"><legend class="legendforfieldsetstep" style="font-size: 3em">1</legend>';
print '<span class="opacitymedium">'; print '<span class="opacitymedium">';
@ -160,14 +162,15 @@ $title = $langs->trans("BackupDumpWizard");
print load_fiche_titre($title); print load_fiche_titre($title);
print '<table class="'.(!empty($useinecm) ? 'nobordernopadding' : 'liste noborderbottom').' nohover centpercent">'; print '<table class="liste nohover centpercent noborderbottom">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b><br>'; print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b><br>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '<tr class="oddeven nohover"><td style="padding-left: 8px" class="nohover">'; print '<tr class="oddeven nohover"><td style="padding-left: 8px" class="nohover">';
print '<table class="centpercent">';
print '<table class="centpercent noborderbottom">';
print '<tr>'; print '<tr>';
print '<td class="tdtop">'; print '<td class="tdtop">';
@ -397,11 +400,15 @@ print '</td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
print '</td></tr>';
print '</table>';
print '<!--<fieldset>'; print '<!--<fieldset>';
print '<legend>'.$langs->trans("Destination").'</legend> -->'; print '<legend>'.$langs->trans("Destination").'</legend> -->';
print '<br>'; print '<br>';
print '<label for="filename_template">'.$langs->trans("FileNameToGenerate").'</label>'; print '<label for="filename_template" class="line-height-large">'.$langs->trans("FileNameToGenerate").'</label>';
print '<br>'; print '<br>';
$prefix = 'dump'; $prefix = 'dump';
$ext = '.sql'; $ext = '.sql';
@ -498,7 +505,6 @@ print "<!--</fieldset>--> <!-- End destination -->\n";
print '<br>'; print '<br>';
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button reposition" value="'.$langs->trans("GenerateBackup").'" id="buttonGo">'; print '<input type="submit" class="button reposition" value="'.$langs->trans("GenerateBackup").'" id="buttonGo">';
print '<input type="hidden" name="page_y" value="'.GETPOST('page_y', 'int').'">';
print '<br>'; print '<br>';
print '<br>'; print '<br>';
@ -532,8 +538,6 @@ if (!empty($_SESSION["commandbackuptorun"])) {
print "</div> <!-- end div center button -->\n"; print "</div> <!-- end div center button -->\n";
print '</td></tr>';
print '</table>';
print "</div> <!-- end div fichehalfleft -->\n"; print "</div> <!-- end div fichehalfleft -->\n";
@ -569,7 +573,7 @@ print '<div id="backupfilesleft" class="fichehalfleft">';
print load_fiche_titre($title ? $title : $langs->trans("BackupZipWizard")); print load_fiche_titre($title ? $title : $langs->trans("BackupZipWizard"));
print '<label for="zipfilename_template">'.$langs->trans("FileNameToGenerate").'</label><br>'; print '<label for="zipfilename_template" class="line-height-large paddingbottom">'.$langs->trans("FileNameToGenerate").'</label><br>';
$prefix = 'documents'; $prefix = 'documents';
$ext = 'zip'; $ext = 'zip';
$file = $prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M"); $file = $prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M");
@ -617,7 +621,7 @@ print '</div>';
print '</div>'; print '</div>';
print '<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;">'; print '<div id="backupfileright" class="fichehalfright" style="height:250px; overflow: auto;">';
$filearray = dol_dir_list($conf->admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ?SORT_ASC:SORT_DESC), 1); $filearray = dol_dir_list($conf->admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ?SORT_ASC:SORT_DESC), 1);
$result = $formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousArchiveFiles")); $result = $formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousArchiveFiles"));

View File

@ -216,8 +216,7 @@ if ($errormsg) {
}*/ }*/
} }
$db->close();
// Redirect to backup page // Redirect to backup page
header("Location: dolibarr_export.php".(GETPOST('page_y', 'int') ? '?page_y='.GETPOST('page_y', 'int') : '')); header("Location: dolibarr_export.php".(GETPOST('page_y', 'int') ? '?page_y='.GETPOST('page_y', 'int') : ''));
$db->close();

View File

@ -127,10 +127,34 @@ $result = dol_mkdir($outputdir);
$utils = new Utils($db); $utils = new Utils($db);
if ($export_type == 'externalmodule' && ! empty($what)) {
$fulldirtocompress = DOL_DOCUMENT_ROOT.'/custom/'.dol_sanitizeFileName($what);
} else {
$fulldirtocompress = DOL_DATA_ROOT;
}
$dirtoswitch = dirname($fulldirtocompress);
$dirtocompress = basename($fulldirtocompress);
if ($compression == 'zip') { if ($compression == 'zip') {
$file .= '.zip'; $file .= '.zip';
$excludefiles = '/(\.back|\.old|\.log|[\/\\\]temp[\/\\\]|documents[\/\\\]admin[\/\\\]documents[\/\\\])/i'; $excludefiles = '/(\.back|\.old|\.log|[\/\\\]temp[\/\\\]|documents[\/\\\]admin[\/\\\]documents[\/\\\])/i';
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, $excludefiles);
//var_dump($fulldirtocompress);
//var_dump($outputdir."/".$file);exit;
$rootdirinzip = '';
if ($export_type == 'externalmodule' && !empty($what)) {
$rootdirinzip = $what;
global $dolibarr_allow_download_external_modules;
if (empty($dolibarr_allow_download_external_modules)) {
print 'Download of external modules is not allowed by $dolibarr_allow_download_external_modules in conf.php file';
$db->close();
exit();
}
}
$ret = dol_compress_dir($fulldirtocompress, $outputdir."/".$file, $compression, $excludefiles, $rootdirinzip);
if ($ret < 0) { if ($ret < 0) {
if ($ret == -2) { if ($ret == -2) {
$langs->load("errors"); $langs->load("errors");
@ -146,10 +170,12 @@ if ($compression == 'zip') {
$outputfile = $conf->admin->dir_temp.'/export_files.'.$userlogin.'.out'; // File used with popen method $outputfile = $conf->admin->dir_temp.'/export_files.'.$userlogin.'.out'; // File used with popen method
$file .= '.tar'; $file .= '.tar';
// We also exclude '/temp/' dir and 'documents/admin/documents'
$cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude 'dolibarr_*.log' --exclude 'documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT);
$result = $utils->executeCLI($cmd, $outputfile); // We also exclude '/temp/' dir and 'documents/admin/documents'
// We make escapement here and call executeCLI without escapement because we don't want to have the '*.log' escaped.
$cmd = "tar -cf ".escapeshellcmd($outputdir."/".$file)." --exclude-vcs --exclude-caches-all --exclude='temp' --exclude='*.log' --exclude='documents/admin/documents' -C '".escapeshellcmd(dol_sanitizePathName($dirtoswitch))."' '".escapeshellcmd(dol_sanitizeFileName($dirtocompress))."'";
$result = $utils->executeCLI($cmd, $outputfile, 0, null, 1);
$retval = $result['error']; $retval = $result['error'];
if ($result['result'] || !empty($retval)) { if ($result['result'] || !empty($retval)) {
@ -173,15 +199,37 @@ if ($compression == 'zip') {
unlink($outputdir."/".$file); unlink($outputdir."/".$file);
} }
} }
} else {
$errormsg = 'Bad value for compression method';
print $errormsg;
} }
if ($export_type != 'externalmodule' || empty($what)) {
if ($errormsg) { if ($errormsg) {
setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors'); setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors');
} else {
setEventMessages($langs->trans("BackupFileSuccessfullyCreated").'.<br>'.$langs->trans("YouCanDownloadBackupFile"), null, 'mesgs');
} }
// Redirect t backup page $db->close();
header("Location: dolibarr_export.php");
$time_end = time(); // Redirect to calling page
$returnto = 'dolibarr_export.php';
header("Location: ".$returnto);
exit();
} else {
$zipname = $outputdir."/".$file;
// Then download the zipped file.
header('Content-Type: application/zip');
header('Content-disposition: attachment; filename='.basename($zipname));
header('Content-Length: '.filesize($zipname));
readfile($zipname);
dol_delete_file($zipname);
$db->close(); $db->close();
exit();
}

View File

@ -499,7 +499,7 @@ if ($result && $action == "dl" && !$error) {
$zip->addFromString('transactions.csv', $log); $zip->addFromString('transactions.csv', $log);
$zip->close(); $zip->close();
///Then download the zipped file. // Then download the zipped file.
header('Content-Type: application/zip'); header('Content-Type: application/zip');
header('Content-disposition: attachment; filename='.basename($zipname)); header('Content-disposition: attachment; filename='.basename($zipname));
header('Content-Length: '.filesize($zipname)); header('Content-Length: '.filesize($zipname));

View File

@ -1066,7 +1066,7 @@ if ($action == 'create') {
// Autogeneration // Autogeneration
$title = $langs->trans("Recurrence"); $title = $langs->trans("Recurrence");
print load_fiche_titre('<span class="fa fa-calendar"></span> '.$title, '', ''); print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"').$title, '', '');
print dol_get_fiche_head(null, '', '', 0); print dol_get_fiche_head(null, '', '', 0);
@ -1455,7 +1455,7 @@ if ($action == 'create') {
print '<table class="border centpercent tableforfield">'; print '<table class="border centpercent tableforfield">';
print '<tr><td colspan="2"><span class="fa fa-calendar"></span> '.$title.'</td></tr>'; print '<tr><td colspan="2">'.img_picto('', 'recurring', 'class="pictofixedwidth"').$title.'</td></tr>';
// if "frequency" is empty or = 0, the reccurence is disabled // if "frequency" is empty or = 0, the reccurence is disabled
print '<tr><td style="width: 50%">'; print '<tr><td style="width: 50%">';

View File

@ -141,7 +141,7 @@ $arrayfields = array(
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>1), 'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>1),
'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0), 'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0),
'f.fk_cond_reglement'=>array('label'=>"PaymentTerm", 'checked'=>0), 'f.fk_cond_reglement'=>array('label'=>"PaymentTerm", 'checked'=>0),
'recurring'=>array('label'=>"RecurringInvoiceTemplate", 'checked'=>1), 'recurring'=>array('label'=>"RecurringInvoice", 'checked'=>1),
'f.frequency'=>array('label'=>"Frequency", 'checked'=>1), 'f.frequency'=>array('label'=>"Frequency", 'checked'=>1),
'f.unit_frequency'=>array('label'=>"FrequencyUnit", 'checked'=>1), 'f.unit_frequency'=>array('label'=>"FrequencyUnit", 'checked'=>1),
'f.nb_gen_done'=>array('label'=>"NbOfGenerationDoneShort", 'checked'=>1), 'f.nb_gen_done'=>array('label'=>"NbOfGenerationDoneShort", 'checked'=>1),
@ -359,7 +359,11 @@ if ($search_date_when_end) {
$sql .= " AND f.date_when <= '".$db->idate($search_date_when_end)."'"; $sql .= " AND f.date_when <= '".$db->idate($search_date_when_end)."'";
} }
$sql .= $db->order($sortfield, $sortorder); $tmpsortfield = $sortfield;
if ($tmpsortfield == 'recurring') {
$tmpsortfield = 'f.frequency';
}
$sql .= $db->order($tmpsortfield, $sortorder);
$nbtotalofrecords = ''; $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
@ -773,8 +777,9 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Is it a recurring invoice
if (!empty($arrayfields['recurring']['checked'])) { if (!empty($arrayfields['recurring']['checked'])) {
print '<td class="center">'.yn($objp->frequency ? 1 : 0).'</td>'; print '<td class="center">'.($objp->frequency ? img_picto($langs->trans("Frequency").': '.$objp->frequency.' '.$objp->unit_frequency, 'recurring', 'class="opacitymedium"').' ' : '').yn($objp->frequency ? 1 : 0).'</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }

View File

@ -331,6 +331,12 @@ $dolibarr_cron_allow_cli='0';
// Examples: // Examples:
// $dolibarr_strict_mode=0; // $dolibarr_strict_mode=0;
// dolibarr_allow_download_external_modules
// Provide a link to download the zip of an external modules installed into custom directory from the web admin.
// Default value: 0
// Examples:
// $dolibarr_allow_download_external_modules=0;
//################################# //#################################

View File

@ -46,7 +46,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
?> ?>
<tr class="<?php echo $trclass; ?>"> <tr class="<?php echo $trclass; ?>">
<td><?php echo $langs->trans("Contract"); ?></td> <td><?php echo $langs->trans("Contract"); ?></td>
<td><?php echo $objectlink->getNomUrl(1); ?></td> <td class="nowraponall"><?php echo $objectlink->getNomUrl(1); ?></td>
<td></td> <td></td>
<td class="center"><?php echo dol_print_date($objectlink->date_contrat, 'day'); ?></td> <td class="center"><?php echo dol_print_date($objectlink->date_contrat, 'day'); ?></td>
<td class="right"><?php <td class="right"><?php

View File

@ -636,7 +636,6 @@ class Utils
$execmethod = 1; $execmethod = 1;
} }
//$execmethod=1; //$execmethod=1;
dol_syslog("Utils::executeCLI execmethod=".$execmethod." system:".$command, LOG_DEBUG); dol_syslog("Utils::executeCLI execmethod=".$execmethod." system:".$command, LOG_DEBUG);
$output_arr = array(); $output_arr = array();

View File

@ -637,8 +637,9 @@ function modules_prepare_head($nbofactivatedmodules, $nboftotalmodules)
$mode = empty($conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT) ? 'commonkanban' : 'common'; $mode = empty($conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT) ? 'commonkanban' : 'common';
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$mode; $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$mode;
if ($nbofactivatedmodules <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) { // If only minimal initial modules enabled) if ($nbofactivatedmodules <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) { // If only minimal initial modules enabled)
$head[$h][1] = $form->textwithpicto($langs->trans("AvailableModules"), $desc); //$head[$h][1] = $form->textwithpicto($langs->trans("AvailableModules"), $desc);
$head[$h][1] .= img_warning($langs->trans("YouMustEnableOneModule")); $head[$h][1] = $langs->trans("AvailableModules");
$head[$h][1] .= $form->textwithpicto('', $langs->trans("YouMustEnableOneModule").'.<br><br><span class="opacitymedium">'.$desc.'</span>', 1, warning);
} else { } else {
//$head[$h][1] = $langs->trans("AvailableModules").$form->textwithpicto('<span class="badge marginleftonly">'.$nbofactivatedmodules.' / '.$nboftotalmodules.'</span>', $desc, 1, 'help', '', 1, 3); //$head[$h][1] = $langs->trans("AvailableModules").$form->textwithpicto('<span class="badge marginleftonly">'.$nbofactivatedmodules.' / '.$nboftotalmodules.'</span>', $desc, 1, 'help', '', 1, 3);
$head[$h][1] = $langs->trans("AvailableModules").'<span class="badge marginleftonly">'.$nbofactivatedmodules.' / '.$nboftotalmodules.'</span>'; $head[$h][1] = $langs->trans("AvailableModules").'<span class="badge marginleftonly">'.$nbofactivatedmodules.' / '.$nboftotalmodules.'</span>';

View File

@ -2004,11 +2004,15 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz", &$errorstring
// Skip directories (they would be added automatically) // Skip directories (they would be added automatically)
if (!$file->isDir()) { if (!$file->isDir()) {
// Get real and relative path for current file // Get real and relative path for current file
$filePath = $file->getRealPath(); $filePath = $file->getPath(); // the full path with filename using the $inputdir root.
$relativePath = substr($filePath, strlen($rootPath) + 1); $fileName = $file->getFilename();
$fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory.
//$relativePath = substr($fileFullRealPath, strlen($rootPath) + 1);
$relativePath = substr(($filePath ? $filePath.'/' : '').$fileName, strlen($rootPath) + 1);
// Add current file to archive // Add current file to archive
$zip->addFile($filePath, $relativePath); $zip->addFile($fileFullRealPath, $relativePath);
} }
} }
@ -2196,22 +2200,29 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles =
} }
// Create recursive directory iterator // Create recursive directory iterator
// This does not return symbolic links
/** @var SplFileInfo[] $files */ /** @var SplFileInfo[] $files */
$files = new RecursiveIteratorIterator( $files = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($inputdir), new RecursiveDirectoryIterator($inputdir),
RecursiveIteratorIterator::LEAVES_ONLY RecursiveIteratorIterator::LEAVES_ONLY
); );
//var_dump($inputdir);
foreach ($files as $name => $file) { foreach ($files as $name => $file) {
// Skip directories (they would be added automatically) // Skip directories (they would be added automatically)
if (!$file->isDir()) { if (!$file->isDir()) {
// Get real and relative path for current file // Get real and relative path for current file
$filePath = $file->getRealPath(); $filePath = $file->getPath(); // the full path with filename using the $inputdir root.
$relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($filePath, strlen($inputdir) + 1); $fileName = $file->getFilename();
$fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory.
if (empty($excludefiles) || !preg_match($excludefiles, $filePath)) { //$relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($fileFullRealPath, strlen($inputdir) + 1);
$relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr(($filePath ? $filePath.'/' : '').$fileName, strlen($inputdir) + 1);
//var_dump($filePath);var_dump($fileFullRealPath);var_dump($relativePath);
if (empty($excludefiles) || !preg_match($excludefiles, $fileFullRealPath)) {
// Add current file to archive // Add current file to archive
$zip->addFile($filePath, $relativePath); $zip->addFile($fileFullRealPath, $relativePath);
} }
} }
} }

View File

@ -835,7 +835,7 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options =
$out = dol_string_onlythesehtmltags($out, 0, 1, 1); $out = dol_string_onlythesehtmltags($out, 0, 1, 1);
// We should also exclude non expected attributes // We should also exclude non expected HTML attributes and clean content of some attributes.
if (!empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)) { if (!empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)) {
// Warning, the function may add a LF so we are forced to trim to compare with old $out without having always a difference and an infinit loop. // Warning, the function may add a LF so we are forced to trim to compare with old $out without having always a difference and an infinit loop.
$out = trim(dol_string_onlythesehtmlattributes($out)); $out = trim(dol_string_onlythesehtmlattributes($out));
@ -3649,7 +3649,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'salary', 'shipment', 'state', 'supplier_invoice', 'supplier_invoicea', 'supplier_invoicer', 'supplier_invoiced', 'salary', 'shipment', 'state', 'supplier_invoice', 'supplier_invoicea', 'supplier_invoicer', 'supplier_invoiced',
'technic', 'ticket', 'technic', 'ticket',
'error', 'warning', 'error', 'warning',
'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', 'recurring',
'shapes', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'shapes', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda', 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
'uncheck', 'user-cog', 'vat', 'website', 'workstation', 'uncheck', 'user-cog', 'vat', 'website', 'workstation',
@ -3695,7 +3695,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'partnership'=>'handshake', 'payment'=>'money-check-alt', 'payment_vat'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell', 'partnership'=>'handshake', 'payment'=>'money-check-alt', 'payment_vat'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
'recent' => 'question', 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', 'recent' => 'question', 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge',
'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
'refresh'=>'redo', 'region'=>'map-marked', 'resource'=>'laptop-house', 'refresh'=>'redo', 'region'=>'map-marked', 'resource'=>'laptop-house', 'recurring'=>'history',
'state'=>'map-marked-alt', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', 'state'=>'map-marked-alt', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s',
'supplier'=>'building', 'technic'=>'cogs', 'supplier'=>'building', 'technic'=>'cogs',
'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
@ -6476,9 +6476,27 @@ function dol_string_onlythesehtmlattributes($stringtoclean, $allowed_attributes
if (is_object($dom)) { if (is_object($dom)) {
for ($els = $dom->getElementsByTagname('*'), $i = $els->length - 1; $i >= 0; $i--) { for ($els = $dom->getElementsByTagname('*'), $i = $els->length - 1; $i >= 0; $i--) {
for ($attrs = $els->item($i)->attributes, $ii = $attrs->length - 1; $ii >= 0; $ii--) { for ($attrs = $els->item($i)->attributes, $ii = $attrs->length - 1; $ii >= 0; $ii--) {
//var_dump($attrs->item($ii));
if (! empty($attrs->item($ii)->name)) {
// Delete attribute if not into allowed_attributes // Delete attribute if not into allowed_attributes
if (! empty($attrs->item($ii)->name) && ! in_array($attrs->item($ii)->name, $allowed_attributes)) { if (! in_array($attrs->item($ii)->name, $allowed_attributes)) {
$els->item($i)->removeAttribute($attrs->item($ii)->name); $els->item($i)->removeAttribute($attrs->item($ii)->name);
} elseif (in_array($attrs->item($ii)->name, array('style'))) {
$valuetoclean = $attrs->item($ii)->value;
do {
$oldvaluetoclean = $valuetoclean;
$valuetoclean = preg_replace('/\/\*.*\*\//m', '', $valuetoclean); // clean css comments
$valuetoclean = preg_replace('/position\s*:\s*[a-z]+/mi', '', $valuetoclean);
if ($els->item($i)->tagName == 'a') { // more paranoiac cleaning for clickable tags.
$valuetoclean = preg_replace('/display\s*://m', '', $valuetoclean);
$valuetoclean = preg_replace('/z-index\s*://m', '', $valuetoclean);
$valuetoclean = preg_replace('/\s+(top|left|right|bottom)\s*://m', '', $valuetoclean);
}
} while ($oldvaluetoclean != $valuetoclean);
$attrs->item($ii)->value = $valuetoclean;
}
} }
} }
} }

View File

@ -93,7 +93,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
$dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists $dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists
$rescode = $dolmemcache->getResultCode(); $rescode = $dolmemcache->getResultCode();
if ($rescode == 0) { if ($rescode == 0) {
return is_countable($data) ? count($data) : 0; return is_array($data) ? count($data) : 0;
} else { } else {
return -$rescode; return -$rescode;
} }
@ -113,7 +113,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
//$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false);
$result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists $result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists
if ($result) { if ($result) {
return is_countable($data) ? count($data) : 0; return is_array($data) ? count($data) : 0;
} else { } else {
return -1; return -1;
} }

View File

@ -1793,6 +1793,31 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->user->user->lire, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"')); $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->user->user->lire, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"'));
$newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->user->user->creer); $newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->user->user->creer);
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->user->user->lire); $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->user->user->lire);
$newmenu->add("/hrm/index.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillsManagement"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"'));
if ($usemenuhider || empty($leftmenu) || $leftmenu == "hrm_sm") {
// Skills
$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("Skills"), 1, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'shapes', 'class="pictofixedwidth"'));
//$newmenu->add("/hrm/skill_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->trans("NewSkill"), 1, $user->rights->hrm->all->write);
//$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read);
// Job (Description of work to do and skills required)
$newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("JobsPosition"), 1, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'technic', 'class="pictofixedwidth"'));
//$newmenu->add("/hrm/job_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Job")), 1, $user->rights->hrm->all->write);
//$newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read);
// Position = Link job - user
$newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("EmployeePositions"), 1, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user-cog', 'class="pictofixedwidth"'));
//$newmenu->add("/hrm/position.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Position")), 1, $user->rights->hrm->all->write);
//$newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read);
// Evaluation
$newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("Evalutions"), 1, $user->rights->hrm->evaluation->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"'));
//$newmenu->add("/hrm/evaluation_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->trans("NewEval"), 1, $user->rights->hrm->evaluation->write);
//$newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->evaluation->read);
$newmenu->add("/hrm/compare.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillComparison"), 1, $user->rights->hrm->evaluation->read || $user->rights->hrm->compare->read);
}
} }
// Leave/Holiday/Vacation module // Leave/Holiday/Vacation module
@ -1850,29 +1875,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire, '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="pictofixedwidth"')); $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire, '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="pictofixedwidth"'));
} }
} }
if (!empty($conf->hrm->enabled)) {
// Skills
$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("skill"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'shapes', 'class="pictofixedwidth"'));
$newmenu->add("/hrm/skill_card.php?mainmenu=hrm&leftmenu=hrm&action=create", $langs->trans("NewSkill"), 1, $user->rights->hrm->all->write);
$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->hrm->all->read);
// Job
$newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("Job"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'technic', 'class="pictofixedwidth"'));
$newmenu->add("/hrm/job_card.php?mainmenu=hrm&leftmenu=hrm&action=create", $langs->transnoentities("NewObject", $langs->trans("Job")), 1, $user->rights->hrm->all->write);
$newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->hrm->all->read);
// Position
$newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("Position"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user-cog', 'class="pictofixedwidth"'));
$newmenu->add("/hrm/position.php?mainmenu=hrm&leftmenu=hrm&action=create", $langs->transnoentities("NewObject", $langs->trans("Position")), 1, $user->rights->hrm->all->write);
$newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->hrm->all->read);
// Evaluation
$newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("Eval"), 0, $user->rights->hrm->evaluation->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"'));
$newmenu->add("/hrm/evaluation_card.php?mainmenu=hrm&leftmenu=hrm&action=create", $langs->trans("NewEval"), 1, $user->rights->hrm->evaluation->write);
$newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->hrm->evaluation->read);
$newmenu->add("/hrm/compare.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("Compare"), 1, $user->rights->hrm->compare->read);
}
} }

View File

@ -176,7 +176,9 @@ class doc_generic_bom_odt extends ModelePDFBom
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -189,7 +189,9 @@ class doc_generic_order_odt extends ModelePDFCommandes
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -174,7 +174,9 @@ class doc_generic_contract_odt extends ModelePDFContract
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -187,7 +187,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -186,7 +186,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -176,7 +176,9 @@ class doc_generic_member_odt extends ModelePDFMember
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -196,21 +196,21 @@ class modHRM extends DolibarrModules
$r = 0; $r = 0;
// Skill / Job / Position // Skill / Job / Position
$this->rights[$r][0] = 4010; // Permission id (must not be already used) $this->rights[$r][0] = 4001; // Permission id (must not be already used)
$this->rights[$r][1] = 'Read skill/job/position'; // Permission label $this->rights[$r][1] = 'Read skill/job/position'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'all'; $this->rights[$r][4] = 'all';
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->all->read) $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->all->read)
$r++; $r++;
$this->rights[$r][0] = 4011; // Permission id (must not be already used) $this->rights[$r][0] = 4002; // Permission id (must not be already used)
$this->rights[$r][1] = 'Create/modify skill/job/position'; // Permission label $this->rights[$r][1] = 'Create/modify skill/job/position'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'all'; $this->rights[$r][4] = 'all';
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->all->write) $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->all->write)
$r++; $r++;
$this->rights[$r][0] = 4012; // Permission id (must not be already used) $this->rights[$r][0] = 4003; // Permission id (must not be already used)
$this->rights[$r][1] = 'Delete skill/job/position'; // Permission label $this->rights[$r][1] = 'Delete skill/job/position'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'all'; $this->rights[$r][4] = 'all';
@ -226,7 +226,7 @@ class modHRM extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 4021; // Permission id (must not be already used) $this->rights[$r][0] = 4021; // Permission id (must not be already used)
$this->rights[$r][1] = 'Create/modify your own evaluation'; // Permission label $this->rights[$r][1] = 'Create/modify your evaluation'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'evaluation'; $this->rights[$r][4] = 'evaluation';
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->write) $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->write)
@ -240,7 +240,7 @@ class modHRM extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 4023; // Permission id (must not be already used) $this->rights[$r][0] = 4023; // Permission id (must not be already used)
$this->rights[$r][1] = 'Delete all evaluations'; // Permission label $this->rights[$r][1] = 'Delete evaluations'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'evaluation'; $this->rights[$r][4] = 'evaluation';
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->delete) $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->delete)

View File

@ -183,7 +183,9 @@ class doc_generic_mo_odt extends ModelePDFMo
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -182,7 +182,9 @@ class doc_generic_product_odt extends ModelePDFProduct
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -474,7 +474,9 @@ class doc_generic_project_odt extends ModelePDFProjects
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -441,7 +441,9 @@ class doc_generic_task_odt extends ModelePDFTask
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -214,7 +214,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -181,7 +181,9 @@ class doc_generic_reception_odt extends ModelePdfReception
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -172,7 +172,9 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -185,7 +185,9 @@ class doc_generic_stock_odt extends ModelePDFStock
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -184,7 +184,9 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -211,7 +211,9 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -173,7 +173,9 @@ class doc_generic_ticket_odt extends ModelePDFTicket
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -205,7 +205,9 @@ class doc_generic_user_odt extends ModelePDFUser
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -197,7 +197,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -936,7 +936,7 @@ if ($resql) {
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag'); $tmptitle = $langs->trans('IncludingProductWithTag');
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1);
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
@ -1367,11 +1367,11 @@ if ($resql) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
if (!empty($arrayfields['f.ref']['checked'])) { if (!empty($arrayfields['f.ref']['checked'])) {
print '<td class="nowrap">'; print '<td class="nowraponall">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
// Picto + Ref // Picto + Ref
print '<td class="nobordernopadding nowrap">'; print '<td class="nobordernopadding nowraponall">';
print $facturestatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1); print $facturestatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
$filename = dol_sanitizeFileName($obj->ref); $filename = dol_sanitizeFileName($obj->ref);

View File

@ -241,29 +241,46 @@ class Skill extends CommonObject
} }
/** /**
* @param int $i rank from which we want to create skilldets * createSkills
*
* @param int $i Rank from which we want to create skilldets (level $i to HRM_MAXRANK wil be created)
* @return null * @return null
*/ */
public function createSkills($i = 1) public function createSkills($i = 1)
{ {
global $conf, $user, $langs; global $conf, $user, $langs;
$MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : self::DEFAULT_MAX_RANK_PER_SKILL; $MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : self::DEFAULT_MAX_RANK_PER_SKILL;
$defaultSkillDesc = !empty($conf->global->HRM_DEFAULT_SKILL_DESCRIPTION) ? $conf->global->HRM_DEFAULT_SKILL_DESCRIPTION : 'no Description'; $defaultSkillDesc = !empty($conf->global->HRM_DEFAULT_SKILL_DESCRIPTION) ? $conf->global->HRM_DEFAULT_SKILL_DESCRIPTION : 'no Description';
$error = 0;
require_once __DIR__ . '/skilldet.class.php'; require_once __DIR__ . '/skilldet.class.php';
$this->db->begin();
// Create level of skills
for ($i; $i <= $MaxNumberSkill ; $i++) { for ($i; $i <= $MaxNumberSkill ; $i++) {
$skilldet = new Skilldet($this->db); $skilldet = new Skilldet($this->db);
$skilldet->description = $defaultSkillDesc . " " . $i; $skilldet->description = $defaultSkillDesc . " " . $i;
$skilldet->rank = $i; $skilldet->rankorder = $i;
$skilldet->fk_skill = $this->id; $skilldet->fk_skill = $this->id;
$result = $skilldet->create($user); $result = $skilldet->create($user);
if ($result <= 0) {
if ($result > 0) { $error++;
setEventMessage($langs->trans('TraductionCreadted'), $i);
} }
} }
if (! $error) {
$this->db->commit();
setEventMessage($langs->trans('SkillCreated'), $i);
return 1;
} else {
$this->db->rollback();
return -1;
}
} }
/** /**
@ -384,7 +401,7 @@ class Skill extends CommonObject
/** /**
* Load object lines in memory from the database * Load object lines in memory from the database
* *
* @return array|int <0 if KO, 0 if not found, array if OK * @return array <0 if KO, array of skill level found
*/ */
public function fetchLines() public function fetchLines()
{ {
@ -393,7 +410,7 @@ class Skill extends CommonObject
$skilldet = new Skilldet($this->db); $skilldet = new Skilldet($this->db);
$this->lines = $skilldet->fetchAll('ASC', '', '', '', array('fk_skill' => $this->id), ''); $this->lines = $skilldet->fetchAll('ASC', '', '', '', array('fk_skill' => $this->id), '');
return (count($this->lines) > 0 ) ? $this->lines : 0; return (count($this->lines) > 0 ) ? $this->lines : array();
} }

View File

@ -104,18 +104,18 @@ class Skilldet extends CommonObject
*/ */
public $fields=array( public $fields=array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'rankorder' => array('type'=>'integer', 'label'=>'rank', 'enabled'=>'1', 'position'=>2, 'notnull'=>0, 'visible'=>2,), 'fk_skill' => array('type'=>'integer:Skill:/hrm/class/skill.class.php', 'label'=>'fk_skill', 'enabled'=>'1', 'position'=>5, 'notnull'=>1, 'visible'=>0,),
'rankorder' => array('type'=>'integer', 'label'=>'rank', 'enabled'=>'1', 'position'=>10, 'notnull'=>0, 'visible'=>2,),
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1,), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1,),
'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_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'=>0,), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>0,),
'fk_skill' => array('type'=>'integer:Skill:/hrm/class/skill.class.php', 'label'=>'fk_skill', 'enabled'=>'1', 'position'=>513, 'notnull'=>1, 'visible'=>0,),
); );
public $rowid; public $rowid;
public $fk_skill;
public $rankorder;
public $description; public $description;
public $fk_user_creat; public $fk_user_creat;
public $fk_user_modif; public $fk_user_modif;
public $fk_skill;
public $rank;
// END MODULEBUILDER PROPERTIES // END MODULEBUILDER PROPERTIES

View File

@ -36,21 +36,25 @@
require_once '../main.inc.php'; require_once '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
ini_set('display_errors', 1);
require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm.lib.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm.lib.php';
$permissiontoread = $user->rights->hrm->compare->read; $permissiontoread = $user->rights->hrm->evaluation->read || $user->rights->hrm->compare->read;
$permissiontoadd = 0;
if (empty($conf->hrm->enabled)) accessforbidden(); if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden();
$langs->load('hrm'); $langs->load('hrm');
/*
* View
*/
$css = array(); $css = array();
$css[] = '/hrm/css/style.css'; $css[] = '/hrm/css/style.css';
llxHeader('', $langs->trans('SkillComparison'), '', '', 0, 0, '', $css); llxHeader('', $langs->trans('SkillComparison'), '', '', 0, 0, '', $css);

View File

@ -153,7 +153,7 @@ if (!empty($conf->holiday->enabled)) {
print '<table class="noborder nohover centpercent">'; print '<table class="noborder nohover centpercent">';
print '<tr class="liste_titre"><th colspan="3">'.$langs->trans("Holidays").'</th></tr>'; print '<tr class="liste_titre"><th colspan="3">'.$langs->trans("Holidays").'</th></tr>';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td colspan="3">'; print '<td>';
$out = ''; $out = '';
$nb_holiday = 0; $nb_holiday = 0;
@ -163,8 +163,9 @@ if (!empty($conf->holiday->enabled)) {
$nb_holiday += $nb_type; $nb_holiday += $nb_type;
$out .= ' - '.($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']).': <strong>'.($nb_type ? price2num($nb_type) : 0).'</strong><br>'; $out .= ' - '.($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']).': <strong>'.($nb_type ? price2num($nb_type) : 0).'</strong><br>';
} }
print $langs->trans('SoldeCPUser', round($nb_holiday, 5)).'<br>'; $balancetoshow = $langs->trans('SoldeCPUser', '{s1}');
print $out; print '<div class="valignmiddle div-balanceofleave">'.str_replace('{s1}', img_picto('', 'holiday', 'class="paddingleft pictofixedwidth"').'<span class="balanceofleave valignmiddle'.($nb_holiday > 0 ? ' amountpaymentcomplete' : ($nb_holiday < 0 ? ' amountremaintopay' : ' amountpaymentneutral')).'">'.round($nb_holiday, 5).'</span>', $balancetoshow).'</div>';
print '<span class="opacitymedium">'.$out.'</span>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -147,7 +147,7 @@ if ($object->id > 0) {
// Object card // Object card
// ------------------------------------------------------------ // ------------------------------------------------------------
$linkback = '<a href="'.dol_buildpath('/hrm/skill_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refid">'; $morehtmlref = '<div class="refid">';
$morehtmlref.= $object->label; $morehtmlref.= $object->label;

View File

@ -84,6 +84,8 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti
if (empty($conf->hrm->enabled)) accessforbidden(); if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden();
$MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : Skill::DEFAULT_MAX_RANK_PER_SKILL;
/* /*
* Actions * Actions
@ -98,14 +100,14 @@ if ($reshook < 0) {
if (empty($reshook)) { if (empty($reshook)) {
$error = 0; $error = 0;
$backurlforlist = dol_buildpath('/hrm/skill_list.php', 1); $backurlforlist = DOL_URL_ROOT.'/hrm/skill_list.php';
if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && empty($id))) {
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist; $backtopage = $backurlforlist;
} else { } else {
$backtopage = dol_buildpath('/hrm/skill_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__'); $backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id=' . ($id > 0 ? $id : '__ID__');
} }
} }
} }
@ -166,8 +168,6 @@ if (empty($reshook)) {
/* /*
* View * View
*
* Put here all code to build page
*/ */
$form = new Form($db); $form = new Form($db);
@ -186,9 +186,9 @@ if ($action == 'create') {
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
print '<input type="hidden" name="token" value="' . newToken() . '">'; print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
$backtopage .= "&objecttype=job"; $backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?' ) ."objecttype=job";
if ($backtopage) { if ($backtopage) {
print '<input type="hidden" name="backtopage" value="' . $backtopage . ' &objecttype=job ">'; print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
} }
if ($backtopageforcancel) { if ($backtopageforcancel) {
print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
@ -254,11 +254,16 @@ if (($id || $ref) && $action == 'edit') {
// SKILLDET // SKILLDET
print dol_get_fiche_head(array(), ''); print dol_get_fiche_head(array(), '');
$SkilldetRecords = $object->fetchLines(); $SkilldetRecords = $object->fetchLines();
if (is_array($SkilldetRecords) && count($SkilldetRecords) == 0) {
$object->createSkills(1);
}
if (is_array($SkilldetRecords) && count($SkilldetRecords) > 0) { if (is_array($SkilldetRecords) && count($SkilldetRecords) > 0) {
print '<table>'; print '<table>';
foreach ($SkilldetRecords as $sk) { foreach ($SkilldetRecords as $sk) {
$MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : Skill::DEFAULT_MAX_RANK_PER_SKILL;
if ($sk->rank > $MaxNumberSkill) { if ($sk->rank > $MaxNumberSkill) {
continue; continue;
} }
@ -397,7 +402,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Object card // Object card
// ------------------------------------------------------------ // ------------------------------------------------------------
$linkback = '<a href="' . dol_buildpath('/hrm/skill_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; $linkback = '<a href="' . DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref = '<div class="refid">'; $morehtmlref = '<div class="refid">';
@ -691,7 +696,6 @@ if ($action != "create" && $action != "edit") {
break; // Should not happen break; // Should not happen
} }
$MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : Skill::DEFAULT_MAX_RANK_PER_SKILL;
if ($obj->rank > $MaxNumberSkill) { if ($obj->rank > $MaxNumberSkill) {
continue; continue;
} }

View File

@ -129,7 +129,7 @@ if ($object->id) {
print dol_get_fiche_head($head, 'contact', '', -1, $object->picto); print dol_get_fiche_head($head, 'contact', '', -1, $object->picto);
$linkback = '<a href="'.dol_buildpath('/hrm/skill_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">'; $morehtmlref = '<div class="refidno">';
/* /*

View File

@ -127,7 +127,7 @@ if ($object->id) {
// Object card // Object card
// ------------------------------------------------------------ // ------------------------------------------------------------
$linkback = '<a href="'.dol_buildpath('/hrm/skill_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refid">'; $morehtmlref = '<div class="refid">';
$morehtmlref.= $object->label; $morehtmlref.= $object->label;

View File

@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) {
// Object card // Object card
// ------------------------------------------------------------ // ------------------------------------------------------------
$linkback = '<a href="'.dol_buildpath('/hrm/skill_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refid">'; $morehtmlref = '<div class="refid">';
$morehtmlref.= $object->label; $morehtmlref.= $object->label;

View File

@ -93,14 +93,14 @@ if ($reshook < 0) {
if (empty($reshook)) { if (empty($reshook)) {
$error = 0; $error = 0;
$backurlforlist = dol_buildpath('/hrm/skill_list.php', 1); $backurlforlist = DOL_URL_ROOT.'/hrm/skill_list.php';
if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && empty($id))) {
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist; $backtopage = $backurlforlist;
} else { } else {
$backtopage = dol_buildpath('/hrm/skill_list.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__'); $backtopage = DOL_URL_ROOT.'/hrm/skill_list.php?id=' . ($id > 0 ? $id : '__ID__');
} }
} }
} }

View File

@ -300,21 +300,12 @@ CREATE TABLE llx_hrm_job_user(
fk_user_modif integer fk_user_modif integer
) ENGINE=innodb; ) ENGINE=innodb;
ALTER TABLE llx_hrm_job_user ADD COLUMN abort_comment varchar(255);
ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_rowid (rowid); ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_rowid (rowid);
-- ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_ref (ref); -- ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_ref (ref);
create table llx_hrm_job_user_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
ALTER TABLE llx_hrm_job_user_extrafields ADD INDEX idx_position_fk_object(fk_object);
CREATE TABLE llx_hrm_skill CREATE TABLE llx_hrm_skill
( (
@ -358,20 +349,11 @@ CREATE TABLE llx_hrm_skilldet
rankorder integer rankorder integer
) ENGINE=innodb; ) ENGINE=innodb;
ALTER TABLE llx_hrm_skilldet ADD COLUMN rankorder integer NOT NULL DEFAULT '1';
ALTER TABLE llx_hrm_skilldet ADD INDEX idx_hrm_skilldet_rowid (rowid); ALTER TABLE llx_hrm_skilldet ADD INDEX idx_hrm_skilldet_rowid (rowid);
ALTER TABLE llx_hrm_skilldet ADD CONSTRAINT llx_hrm_skilldet_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); ALTER TABLE llx_hrm_skilldet ADD CONSTRAINT llx_hrm_skilldet_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
create table llx_hrm_skilldet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
ALTER TABLE llx_hrm_skilldet_extrafields ADD INDEX idx_skilldet_fk_object(fk_object);
CREATE TABLE llx_hrm_skillrank CREATE TABLE llx_hrm_skillrank
( (
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,

View File

@ -1,21 +0,0 @@
-- Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
-- Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
-- Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- 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/.
-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_hrm_job_user_extrafields ADD INDEX idx_position_fk_object(fk_object);
-- END MODULEBUILDER INDEXES

View File

@ -1,25 +0,0 @@
-- Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
-- Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
-- Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- 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/.
create table llx_hrm_job_user_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -18,9 +18,9 @@
CREATE TABLE llx_hrm_skilldet( CREATE TABLE llx_hrm_skilldet(
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
fk_skill integer NOT NULL,
rankorder integer NOT NULL DEFAULT '1',
description text, description text,
fk_user_creat integer NOT NULL, fk_user_creat integer NOT NULL,
fk_user_modif integer, fk_user_modif integer
fk_skill integer NOT NULL,
rankorder integer
) ENGINE=innodb; ) ENGINE=innodb;

View File

@ -1,21 +0,0 @@
-- Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
-- Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
-- Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- 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/.
-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_hrm_skilldet_extrafields ADD INDEX idx_skilldet_fk_object(fk_object);
-- END MODULEBUILDER INDEXES

View File

@ -1,24 +0,0 @@
-- Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
-- Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
-- Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- 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/.
create table llx_hrm_skilldet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -154,8 +154,8 @@ if ($action == "set") {
/************************************************************************************** /**************************************************************************************
* *
* Chargement fichiers tables/*.sql (non *.key.sql) * Load files tables/*.sql (not the *.key.sql). Files with '-xxx' in name are excluded (they will be loaded during activation o fmodule 'xxx').
* A faire avant les fichiers *.key.sql * To do before the files *.key.sql
* *
***************************************************************************************/ ***************************************************************************************/
if ($ok && $createtables) { if ($ok && $createtables) {
@ -169,7 +169,7 @@ if ($action == "set") {
$tabledata = array(); $tabledata = array();
if (is_resource($handle)) { if (is_resource($handle)) {
while (($file = readdir($handle)) !== false) { while (($file = readdir($handle)) !== false) {
if (preg_match('/\.sql$/i', $file) && preg_match('/^llx_/i', $file) && !preg_match('/\.key\.sql$/i', $file)) { if (preg_match('/\.sql$/i', $file) && preg_match('/^llx_/i', $file) && !preg_match('/\.key\.sql$/i', $file) && !preg_match('/\-/', $file)) {
$tablefound++; $tablefound++;
$tabledata[] = $file; $tabledata[] = $file;
} }
@ -252,8 +252,8 @@ if ($action == "set") {
/*************************************************************************************** /***************************************************************************************
* *
* Chargement fichiers tables/*.key.sql * Load files tables/*.key.sql. Files with '-xxx' in name are excluded (they will be loaded during activation o fmodule 'xxx').
* A faire apres les fichiers *.sql * To do after the files *.sql
* *
***************************************************************************************/ ***************************************************************************************/
if ($ok && $createkeys) { if ($ok && $createkeys) {
@ -267,7 +267,7 @@ if ($action == "set") {
$tabledata = array(); $tabledata = array();
if (is_resource($handle)) { if (is_resource($handle)) {
while (($file = readdir($handle)) !== false) { while (($file = readdir($handle)) !== false) {
if (preg_match('/\.sql$/i', $file) && preg_match('/^llx_/i', $file) && preg_match('/\.key\.sql$/i', $file)) { if (preg_match('/\.sql$/i', $file) && preg_match('/^llx_/i', $file) && preg_match('/\.key\.sql$/i', $file) && !preg_match('/\-/', $file)) {
$tablefound++; $tablefound++;
$tabledata[] = $file; $tabledata[] = $file;
} }
@ -372,7 +372,7 @@ if ($action == "set") {
/*************************************************************************************** /***************************************************************************************
* *
* Chargement fichier functions.sql * Lod the file 'functions.sql'
* *
***************************************************************************************/ ***************************************************************************************/
if ($ok && $createfunctions) { if ($ok && $createfunctions) {
@ -449,7 +449,7 @@ if ($action == "set") {
/*************************************************************************************** /***************************************************************************************
* *
* Load files data/*.sql * Load files data/*.sql. Files with '-xxx' in name are excluded (they will be loaded during activation o fmodule 'xxx').
* *
***************************************************************************************/ ***************************************************************************************/
if ($ok && $createdata) { if ($ok && $createdata) {
@ -463,7 +463,7 @@ if ($action == "set") {
$tabledata = array(); $tabledata = array();
if (is_resource($handle)) { if (is_resource($handle)) {
while (($file = readdir($handle)) !== false) { while (($file = readdir($handle)) !== false) {
if (preg_match('/\.sql$/i', $file) && preg_match('/^llx_/i', $file)) { if (preg_match('/\.sql$/i', $file) && preg_match('/^llx_/i', $file) && !preg_match('/\-/', $file)) {
if (preg_match('/^llx_accounting_account_/', $file)) { if (preg_match('/^llx_accounting_account_/', $file)) {
continue; // We discard data file of chart of account. Will be loaded when a chart is selected. continue; // We discard data file of chart of account. Will be loaded when a chart is selected.
} }

View File

@ -404,7 +404,7 @@ if ($action == "set" && $success) {
// If upgrade // If upgrade
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) { if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) {
// Upgrade is finished // Upgrade is finished
print '<img class="valignmiddle inline-block paddingright" src="../theme/common/octicons/build/svg/checklist.svg" width="20" alt="Configuration"> '.$langs->trans("SystemIsUpgraded")."<br>"; print '<img class="valignmiddle inline-block paddingright" src="../theme/common/octicons/build/svg/checklist.svg" width="20" alt="Configuration"> <span class="valignmiddle">'.$langs->trans("SystemIsUpgraded")."</span><br>";
$createlock = 0; $createlock = 0;

View File

@ -2211,3 +2211,5 @@ IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, yo
IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sales tax IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sales tax
PDF_USE_1A=Generate PDF with PDF/A-1b format PDF_USE_1A=Generate PDF with PDF/A-1b format
MissingTranslationForConfKey = Missing translation for %s MissingTranslationForConfKey = Missing translation for %s
NativeModules=Native modules
NoDeployedModulesFoundWithThisSearchCriteria=No modules found for these search criteria

View File

@ -280,6 +280,7 @@ SetMode=Set Payment Type
SetRevenuStamp=Set revenue stamp SetRevenuStamp=Set revenue stamp
Billed=Billed Billed=Billed
RecurringInvoices=Recurring invoices RecurringInvoices=Recurring invoices
RecurringInvoice=Recurring invoice
RepeatableInvoice=Template invoice RepeatableInvoice=Template invoice
RepeatableInvoices=Template invoices RepeatableInvoices=Template invoices
Repeatable=Template Repeatable=Template

View File

@ -271,6 +271,7 @@ CheckVersionFail=Version check fail
ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it
ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify.
ErrorIsNotADraft=%s is not a draft ErrorIsNotADraft=%s is not a draft
ErrorExecIdFailed=Can't execute command "id"
# Warnings # Warnings
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.

View File

@ -27,7 +27,7 @@ DescCP=Description
SendRequestCP=Create leave request SendRequestCP=Create leave request
DelayToRequestCP=Leave requests must be made at least <b>%s day(s)</b> before them. DelayToRequestCP=Leave requests must be made at least <b>%s day(s)</b> before them.
MenuConfCP=Balance of leave MenuConfCP=Balance of leave
SoldeCPUser=Leave balance is <b>%s</b> days. SoldeCPUser=Leave balance (in days) <b>%s</b>
ErrorEndDateCP=You must select an end date greater than the start date. ErrorEndDateCP=You must select an end date greater than the start date.
ErrorSQLCreateCP=An SQL error occurred during the creation: ErrorSQLCreateCP=An SQL error occurred during the creation:
ErrorIDFicheCP=An error has occurred, the leave request does not exist. ErrorIDFicheCP=An error has occurred, the leave request does not exist.

View File

@ -20,13 +20,14 @@ Employee=Employee
NewEmployee=New employee NewEmployee=New employee
ListOfEmployees=List of employees ListOfEmployees=List of employees
HrmSetup=HRM module setup HrmSetup=HRM module setup
HRM_MAXRANK=Maximum rank for a skill SkillsManagement=Skills management
HRM_MAXRANK=Maximum number of levels to rank a skill
HRM_DEFAULT_SKILL_DESCRIPTION=Default description of ranks when skill is created HRM_DEFAULT_SKILL_DESCRIPTION=Default description of ranks when skill is created
deplacement=Shift deplacement=Shift
DateEval=Evaluation date DateEval=Evaluation date
JobCard=Job card JobCard=Job card
Job=Job JobPosition=Job
Jobs=Jobs JobsPosition=Jobs
NewSkill=New Skill NewSkill=New Skill
SkillType=Skill type SkillType=Skill type
Skilldets=List of ranks for this skill Skilldets=List of ranks for this skill
@ -47,9 +48,8 @@ ConfirmValidateEvaluation=Are you sure you want to validate this evaluation with
EvaluationCard=Evaluation card EvaluationCard=Evaluation card
RequiredRank=Required rank for this job RequiredRank=Required rank for this job
EmployeeRank=Employee rank for this skill EmployeeRank=Employee rank for this skill
Position=Position EmployeePosition=Employee position
Positions=Positions EmployeePositions=Employee positions
PositionCard=Position card
EmployeesInThisPosition=Employees in this position EmployeesInThisPosition=Employees in this position
group1ToCompare=Usergroup to analyze group1ToCompare=Usergroup to analyze
group2ToCompare=Second usergroup for comparison group2ToCompare=Second usergroup for comparison

View File

@ -182,7 +182,9 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
$texte .= '</td>'; $texte .= '</td>';
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">'; $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
$texte .= '<span class="opacitymedium">';
$texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
$texte .= '</span>';
$texte .= '</td>'; $texte .= '</td>';
$texte .= '</tr>'; $texte .= '</tr>';

View File

@ -751,6 +751,9 @@ $url = DOL_URL_ROOT.'/projet/card.php?action=create';
if (!empty($socid)) { if (!empty($socid)) {
$url .= '&socid='.$socid; $url .= '&socid='.$socid;
} }
if ($search_usage_event_organization == 1) {
$url .= '&usage_organize_event=1';
}
$newcardbutton = dolGetButtonTitle($langs->trans('NewProject'), '', 'fa fa-plus-circle', $url, '', $user->rights->projet->creer); $newcardbutton = dolGetButtonTitle($langs->trans('NewProject'), '', 'fa fa-plus-circle', $url, '', $user->rights->projet->creer);
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -818,7 +818,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
print '<div class="fichehalfright">'; print '<div class="fichehalfright">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield center">'; print '<table class="border tableforfield centpercent">';
// Description // Description
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>'; print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';

View File

@ -174,6 +174,7 @@ function llxFooterVierge()
/* /*
* Actions * Actions
*/ */
$parameters = array(); $parameters = array();
// Note that $action and $object may have been modified by some hooks // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
@ -385,75 +386,25 @@ if (empty($reshook) && $action == 'add') {
} }
if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE) && $conf->global->MEMBER_NEWFORM_PAYONLINE != '-1') { if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE) && $conf->global->MEMBER_NEWFORM_PAYONLINE != '-1') {
if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'all') { if (empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { // If edition of amount not allowed
$urlback = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref); // TODO Check amount is same than the amount required for the type of member or if not defined as the defeault amount into $conf->global->MEMBER_NEWFORM_AMOUNT
if (price2num(GETPOST('amount', 'alpha'))) { // It is not so important because a test is done on return of payment validation.
$urlback .= '&amount='.price2num(GETPOST('amount', 'alpha'));
} }
$urlback = getOnlinePaymentUrl(0, 'member', $adh->ref, price2num(GETPOST('amount', 'alpha'), 'MT'), '', 0);
if (GETPOST('email')) { if (GETPOST('email')) {
$urlback .= '&email='.urlencode(GETPOST('email')); $urlback .= '&email='.urlencode(GETPOST('email'));
} }
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if ($conf->global->MEMBER_NEWFORM_PAYONLINE != '-1' && $conf->global->MEMBER_NEWFORM_PAYONLINE != 'all') {
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { $urlback .= '&paymentmethod='.urlencode($conf->global->MEMBER_NEWFORM_PAYONLINE);
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
} else {
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
}
}
} elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox') {
$urlback = DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
if (price2num(GETPOST('amount', 'alpha'))) {
$urlback .= '&amount='.price2num(GETPOST('amount', 'alpha'));
}
if (GETPOST('email')) {
$urlback .= '&email='.urlencode(GETPOST('email'));
}
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
} else {
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
}
}
} elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal') {
$urlback = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
if (price2num(GETPOST('amount', 'alpha'))) {
$urlback .= '&amount='.price2num(GETPOST('amount', 'alpha'));
}
if (GETPOST('email')) {
$urlback .= '&email='.urlencode(GETPOST('email'));
}
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
} else {
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
}
}
} elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'stripe') {
$urlback = DOL_MAIN_URL_ROOT.'/public/stripe/newpayment.php?from=membernewform&source=membersubscription&ref='.$adh->ref;
if (price2num(GETPOST('amount', 'alpha'))) {
$urlback .= '&amount='.price2num(GETPOST('amount', 'alpha'));
}
if (GETPOST('email')) {
$urlback .= '&email='.urlencode(GETPOST('email'));
}
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
} else {
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
}
} }
} else { } else {
dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment"); if (!empty($entity)) {
exit; $urlback .= '&entity='.((int) $entity);
} }
} }
if (!empty($entity)) {
$urlback .= '&entity='.$entity;
}
dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback); dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback);
} else { } else {
$error++; $error++;
@ -721,21 +672,24 @@ if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) {
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) {
// $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount $amount = 0;
$typeid = $conf->global->MEMBER_NEWFORM_FORCETYPE ? $conf->global->MEMBER_NEWFORM_FORCETYPE : GETPOST('typeid', 'int');
// Set amount for the subscription // Set amount for the subscription:
$amountbytype = $adht->amountByType(1); // - First check the amount of the member type.
$amount = !empty($amountbytype[GETPOST('typeid', 'int')]) ? $amountbytype[GETPOST('typeid', 'int')] : (isset($amount) ? $amount : 0); $amountbytype = $adht->amountByType(1); // Load the array of amount per type
$amount = empty($amountbytype[$typeid]) ? (isset($amount) ? $amount : 0) : $amountbytype[$typeid];
if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { // - If not found, take the default amount
if (empty($amount) && !empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
$amount = $conf->global->MEMBER_NEWFORM_AMOUNT; $amount = $conf->global->MEMBER_NEWFORM_AMOUNT;
} }
// - If not set, we accept ot have amount defined as parameter (for backward compatibility).
if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { if (empty($amount)) {
$amount = $amount ? $amount : (GETPOST('amount') ? price2num(GETPOST('amount'), 'MT', 2) : $conf->global->MEMBER_NEWFORM_AMOUNT); $amount = (GETPOST('amount') ? price2num(GETPOST('amount', 'alpha'), 'MT', 2) : '');
} }
// Clean the amount
$amount = price2num($amount); $amount = price2num($amount);
// $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe' // $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe'
@ -749,6 +703,7 @@ if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER
print ' '.$langs->trans("Currency".$conf->currency); print ' '.$langs->trans("Currency".$conf->currency);
print '</td></tr>'; print '</td></tr>';
} }
print "</table>\n"; print "</table>\n";
print dol_get_fiche_end(); print dol_get_fiche_end();

View File

@ -189,6 +189,7 @@ $validpaymentmethod = array();
// Detect $paymentmethod // Detect $paymentmethod
foreach ($_POST as $key => $val) { foreach ($_POST as $key => $val) {
$reg = array();
if (preg_match('/^dopayment_(.*)$/', $key, $reg)) { if (preg_match('/^dopayment_(.*)$/', $key, $reg)) {
$paymentmethod = $reg[1]; $paymentmethod = $reg[1];
break; break;
@ -480,7 +481,7 @@ if ($action == 'dopayment') {
// Called when choosing Stripe mode. // Called when choosing Stripe mode.
// When using the Charge API architecture, this code is called after clicking the 'dopayment' with the Charge API architecture. // When using the Charge API architecture, this code is called after clicking the 'dopayment' with the Charge API architecture.
// When using the PaymentIntent API architecture, the Stripe customer is already created when creating PaymentIntent when showing payment page and the payment is already ok. // When using the PaymentIntent API architecture, the Stripe customer was already created when creating PaymentIntent when showing payment page, and the payment is already ok when action=charge.
if ($action == 'charge' && !empty($conf->stripe->enabled)) { if ($action == 'charge' && !empty($conf->stripe->enabled)) {
$amountstripe = $amount; $amountstripe = $amount;
@ -767,9 +768,23 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) {
setEventMessages($paymentintent->status, null, 'errors'); setEventMessages($paymentintent->status, null, 'errors');
$action = ''; $action = '';
} else { } else {
// TODO We can alse record the payment mode into llx_societe_rib with stripe $paymentintent->payment_method // TODO We can also record the payment mode into llx_societe_rib with stripe $paymentintent->payment_method
// Note that with other old Stripe architecture (using Charge API), the payment mode was not recorded, so it is not mandatory to do it here. // Note that with other old Stripe architecture (using Charge API), the payment mode was not recorded, so it is not mandatory to do it here.
//dol_syslog("Create payment_method for ".$paymentintent->payment_method, LOG_DEBUG, 0, '_stripe'); //dol_syslog("Create payment_method for ".$paymentintent->payment_method, LOG_DEBUG, 0, '_stripe');
// Get here amount and currency used for payment and force value into $amount and $currency so the real amount is saved into session instead
// of the amount and currency retreived from the POST.
if (!empty($paymentintent->currency) && !empty($paymentintent->amount)) {
$currency = strtoupper($paymentintent->currency);
$amount = $paymentintent->amount;
// Correct the amount according to unit of currency
// See https://support.stripe.com/questions/which-zero-decimal-currencies-does-stripe-support
$arrayzerounitcurrency = array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
if (!in_array($currency, $arrayzerounitcurrency)) {
$amount = $amount / 100;
}
}
} }
} }
@ -1325,7 +1340,7 @@ if ($source == 'contractline') {
$qty = 1; $qty = 1;
if (GETPOST('qty')) { if (GETPOST('qty')) {
$qty = GETPOST('qty'); $qty = price2num(GETPOST('qty', 'alpha'), 'MS');
} }
// Creditor // Creditor
@ -1460,9 +1475,12 @@ if ($source == 'member' || $source == 'membersubscription') {
$langs->load("members"); $langs->load("members");
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
$member = new Adherent($db); $member = new Adherent($db);
$adht = new AdherentType($db);
$result = $member->fetch('', $ref); $result = $member->fetch('', $ref);
if ($result <= 0) { if ($result <= 0) {
$mesg = $member->error; $mesg = $member->error;
@ -1470,6 +1488,8 @@ if ($source == 'member' || $source == 'membersubscription') {
} else { } else {
$member->fetch_thirdparty(); $member->fetch_thirdparty();
$subscription = new Subscription($db); $subscription = new Subscription($db);
$adht->fetch($member->typeid);
} }
$object = $member; $object = $member;
@ -1478,6 +1498,11 @@ if ($source == 'member' || $source == 'membersubscription') {
if (GETPOST("amount", 'alpha')) { if (GETPOST("amount", 'alpha')) {
$amount = GETPOST("amount", 'alpha'); $amount = GETPOST("amount", 'alpha');
} }
// If amount still not defined, we take amount of the type of member
if (empty($amount)) {
$amount = $adht->amount;
}
$amount = price2num($amount, 'MT'); $amount = price2num($amount, 'MT');
} }

View File

@ -343,6 +343,9 @@ if (empty($FinalPaymentAmt)) {
if (empty($paymentType)) { if (empty($paymentType)) {
$paymentType = $_SESSION["paymentType"]; $paymentType = $_SESSION["paymentType"];
} }
if (empty($currencyCodeType)) {
$currencyCodeType = $_SESSION['currencyCodeType'];
}
$fulltag = $FULLTAG; $fulltag = $FULLTAG;
$tmptag = dolExplodeIntoArray($fulltag, '.', '='); $tmptag = dolExplodeIntoArray($fulltag, '.', '=');
@ -386,7 +389,7 @@ if ($ispaymentok) {
$adht = new AdherentType($db); $adht = new AdherentType($db);
$object = new Adherent($db); $object = new Adherent($db);
$result1 = $object->fetch($tmptag['MEM']); $result1 = $object->fetch((int) $tmptag['MEM']);
$result2 = $adht->fetch($object->typeid); $result2 = $adht->fetch($object->typeid);
dol_syslog("We have to process member with id=".$tmptag['MEM']." result1=".$result1." result2=".$result2, LOG_DEBUG, 0, '_payment'); dol_syslog("We have to process member with id=".$tmptag['MEM']." result1=".$result1." result2=".$result2, LOG_DEBUG, 0, '_payment');
@ -403,19 +406,51 @@ if ($ispaymentok) {
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
} }
if (empty($paymentTypeId)) { if (empty($paymentTypeId)) {
$paymentType = $_SESSION["paymentType"];
if (empty($paymentType)) { if (empty($paymentType)) {
$paymentType = 'CB'; $paymentType = 'CB';
} }
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
} }
$currencyCodeType = $_SESSION['currencyCodeType']; dol_syslog("FinalPaymentAmt=".$FinalPaymentAmt." paymentTypeId=".$paymentTypeId." currencyCodeType=".$currencyCodeType, LOG_DEBUG, 0, '_payment');
dol_syslog("FinalPaymentAmt=".$FinalPaymentAmt." paymentTypeId=".$paymentTypeId, LOG_DEBUG, 0, '_payment');
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) {
// Security protection:
if (empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { // If we didn't allow members to choose their membership amount
if ($object->status == $object::STATUS_DRAFT) { // If the member is not yet validated, we check that the amount is the same as expected.
$typeid = $object->typeid;
// Set amount for the subscription:
// - First check the amount of the member type.
$amountbytype = $adht->amountByType(1); // Load the array of amount per type
$amountexpected = empty($amountbytype[$typeid]) ? 0 : $amountbytype[$typeid];
// - If not found, take the default amount
if (empty($amountexpected) && !empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
$amountexpected = $conf->global->MEMBER_NEWFORM_AMOUNT;
}
if ($amountexpected && $amountexpected != $FinalPaymentAmt) {
$error++;
$errmsg = 'Value of FinalPayment ('.$FinalPaymentAmt.') differs from value expected for membership ('.$amountexpected.'). May be a hack to try to pay a different amount ?';
$postactionmessages[] = $errmsg;
$ispostactionok = -1;
dol_syslog("Failed to validate member (bad amount check): ".$errmsg, LOG_ERR, 0, '_payment');
}
}
}
// Security protection:
if ($currencyCodeType && $currencyCodeType != $conf->currency) { // Check that currency is the good one
$error++;
$errmsg = 'Value of currencyCodeType ('.$currencyCodeType.') differs from value expected for membership ('.$conf->currency.'). May be a hack to try to pay a different amount ?';
$postactionmessages[] = $errmsg;
$ispostactionok = -1;
dol_syslog("Failed to validate member (bad currency check): ".$errmsg, LOG_ERR, 0, '_payment');
}
if (! $error) {
// We validate the member (no effect if it is already validated)
$result = ($object->status == $object::STATUS_EXCLUDED) ? -1 : $object->validate($user); // if membre is excluded (status == -2) the new validation is not possible $result = ($object->status == $object::STATUS_EXCLUDED) ? -1 : $object->validate($user); // if membre is excluded (status == -2) the new validation is not possible
if ($result < 0 || empty($object->datevalid)) { if ($result < 0 || empty($object->datevalid)) {
$error++; $error++;
@ -425,6 +460,7 @@ if ($ispaymentok) {
$ispostactionok = -1; $ispostactionok = -1;
dol_syslog("Failed to validate member: ".$errmsg, LOG_ERR, 0, '_payment'); dol_syslog("Failed to validate member: ".$errmsg, LOG_ERR, 0, '_payment');
} }
}
// Subscription informations // Subscription informations
$datesubscription = $object->datevalid; $datesubscription = $object->datevalid;
@ -721,7 +757,7 @@ if ($ispaymentok) {
// Record payment // Record payment
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$object = new Facture($db); $object = new Facture($db);
$result = $object->fetch($tmptag['INV']); $result = $object->fetch((int) $tmptag['INV']);
if ($result) { if ($result) {
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
@ -736,15 +772,12 @@ if ($ispaymentok) {
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
} }
if (empty($paymentTypeId)) { if (empty($paymentTypeId)) {
$paymentType = $_SESSION["paymentType"];
if (empty($paymentType)) { if (empty($paymentType)) {
$paymentType = 'CB'; $paymentType = 'CB';
} }
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
} }
$currencyCodeType = $_SESSION['currencyCodeType'];
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) {
$db->begin(); $db->begin();
@ -827,7 +860,7 @@ if ($ispaymentok) {
} elseif (array_key_exists('ORD', $tmptag) && $tmptag['ORD'] > 0) { } elseif (array_key_exists('ORD', $tmptag) && $tmptag['ORD'] > 0) {
include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
$object = new Commande($db); $object = new Commande($db);
$result = $object->fetch($tmptag['ORD']); $result = $object->fetch((int) $tmptag['ORD']);
if ($result) { if ($result) {
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
@ -836,13 +869,10 @@ if ($ispaymentok) {
if ($paymentmethod == 'paypal') $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS; if ($paymentmethod == 'paypal') $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS;
if ($paymentmethod == 'stripe') $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; if ($paymentmethod == 'stripe') $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
if (empty($paymentTypeId)) { if (empty($paymentTypeId)) {
$paymentType = $_SESSION["paymentType"];
if (empty($paymentType)) $paymentType = 'CB'; if (empty($paymentType)) $paymentType = 'CB';
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
} }
$currencyCodeType = $_SESSION['currencyCodeType'];
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
if (!empty($conf->facture->enabled)) { if (!empty($conf->facture->enabled)) {
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0 ) { if (!empty($FinalPaymentAmt) && $paymentTypeId > 0 ) {
@ -932,10 +962,8 @@ if ($ispaymentok) {
} elseif (array_key_exists('DON', $tmptag) && $tmptag['DON'] > 0) { } elseif (array_key_exists('DON', $tmptag) && $tmptag['DON'] > 0) {
include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
$don = new Don($db); $don = new Don($db);
$result = $don->fetch($tmptag['DON']); $result = $don->fetch((int) $tmptag['DON']);
if ($result) { if ($result) {
$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;
@ -947,15 +975,12 @@ if ($ispaymentok) {
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
} }
if (empty($paymentTypeId)) { if (empty($paymentTypeId)) {
$paymentType = $_SESSION["paymentType"];
if (empty($paymentType)) { if (empty($paymentType)) {
$paymentType = 'CB'; $paymentType = 'CB';
} }
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
} }
$currencyCodeType = $_SESSION['currencyCodeType'];
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) {
$db->begin(); $db->begin();
@ -1044,8 +1069,6 @@ if ($ispaymentok) {
$object = new Facture($db); $object = new Facture($db);
$result = $object->fetch($ref); $result = $object->fetch($ref);
if ($result) { if ($result) {
$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;
@ -1057,15 +1080,12 @@ if ($ispaymentok) {
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
} }
if (empty($paymentTypeId)) { if (empty($paymentTypeId)) {
$paymentType = $_SESSION["paymentType"];
if (empty($paymentType)) { if (empty($paymentType)) {
$paymentType = 'CB'; $paymentType = 'CB';
} }
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
} }
$currencyCodeType = $_SESSION['currencyCodeType'];
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) {
$resultvalidate = $object->validate($user); $resultvalidate = $object->validate($user);
@ -1141,7 +1161,7 @@ if ($ispaymentok) {
if (!$error) { if (!$error) {
// Validating the attendee // Validating the attendee
$attendeetovalidate = new ConferenceOrBoothAttendee($db); $attendeetovalidate = new ConferenceOrBoothAttendee($db);
$resultattendee = $attendeetovalidate->fetch($tmptag['ATT']); $resultattendee = $attendeetovalidate->fetch((int) $tmptag['ATT']);
if ($resultattendee < 0) { if ($resultattendee < 0) {
$error++; $error++;
setEventMessages(null, $attendeetovalidate->errors, "errors"); setEventMessages(null, $attendeetovalidate->errors, "errors");
@ -1241,15 +1261,12 @@ if ($ispaymentok) {
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
} }
if (empty($paymentTypeId)) { if (empty($paymentTypeId)) {
$paymentType = $_SESSION["paymentType"];
if (empty($paymentType)) { if (empty($paymentType)) {
$paymentType = 'CB'; $paymentType = 'CB';
} }
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
} }
$currencyCodeType = $_SESSION['currencyCodeType'];
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) {
$resultvalidate = $object->validate($user); $resultvalidate = $object->validate($user);
@ -1325,7 +1342,7 @@ if ($ispaymentok) {
if (!$error) { if (!$error) {
// Putting the booth to "suggested" state // Putting the booth to "suggested" state
$booth = new ConferenceOrBooth($db); $booth = new ConferenceOrBooth($db);
$resultbooth = $booth->fetch($tmptag['BOO']); $resultbooth = $booth->fetch((int) $tmptag['BOO']);
if ($resultbooth < 0) { if ($resultbooth < 0) {
$error++; $error++;
setEventMessages(null, $booth->errors, "errors"); setEventMessages(null, $booth->errors, "errors");
@ -1490,12 +1507,12 @@ if ($ispaymentok) {
$topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived"); $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived");
$content = ""; $content = "";
if (array_key_exists('MEM', $tmptag)) { if (array_key_exists('MEM', $tmptag)) {
$url = $urlwithroot."/adherents/subscription.php?rowid=".$tmptag['MEM']; $url = $urlwithroot."/adherents/subscription.php?rowid=".((int) $tmptag['MEM']);
$content .= '<strong>'.$companylangs->trans("PaymentSubscription")."</strong><br><br>\n"; $content .= '<strong>'.$companylangs->trans("PaymentSubscription")."</strong><br><br>\n";
$content .= $companylangs->trans("MemberId").': <strong>'.$tmptag['MEM']."</strong><br>\n"; $content .= $companylangs->trans("MemberId").': <strong>'.$tmptag['MEM']."</strong><br>\n";
$content .= $companylangs->trans("Link").': <a href="'.$url.'">'.$url.'</a>'."<br>\n"; $content .= $companylangs->trans("Link").': <a href="'.$url.'">'.$url.'</a>'."<br>\n";
} elseif (array_key_exists('INV', $tmptag)) { } elseif (array_key_exists('INV', $tmptag)) {
$url = $urlwithroot."/compta/facture/card.php?id=".$tmptag['INV']; $url = $urlwithroot."/compta/facture/card.php?id=".((int) $tmptag['INV']);
$content .= '<strong>'.$companylangs->trans("Payment")."</strong><br><br>\n"; $content .= '<strong>'.$companylangs->trans("Payment")."</strong><br><br>\n";
$content .= $companylangs->trans("InvoiceId").': <strong>'.$tmptag['INV']."</strong><br>\n"; $content .= $companylangs->trans("InvoiceId").': <strong>'.$tmptag['INV']."</strong><br>\n";
//$content.=$companylangs->trans("ThirdPartyId").': '.$tmptag['CUS']."<br>\n"; //$content.=$companylangs->trans("ThirdPartyId").': '.$tmptag['CUS']."<br>\n";
@ -1657,6 +1674,8 @@ if ($ispaymentok) {
print "\n</div>\n"; print "\n</div>\n";
print "<!-- Info for payment: FinalPaymentAmt=".dol_escape_htmltag($FinalPaymentAmt)." paymentTypeId=".dol_escape_htmltag($paymentTypeId)." currencyCodeType=".dol_escape_htmltag($currencyCodeType)." -->\n";
htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix); htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix);

View File

@ -28,11 +28,16 @@ session_cache_limiter('public');
require_once '../../main.inc.php'; require_once '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
// Security
if ($dolibarr_main_prod) { if ($dolibarr_main_prod) {
accessforbidden(); accessforbidden();
} }
/*
* View
*/
llxHeader('', 'Documentation and examples for theme'); llxHeader('', 'Documentation and examples for theme');
?> ?>
<h1 class="bd-title" id="content">Badges</h1> <h1 class="bd-title" id="content">Badges</h1>

View File

@ -28,11 +28,16 @@ session_cache_limiter('public');
require_once '../../main.inc.php'; require_once '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
// Security
if ($dolibarr_main_prod) { if ($dolibarr_main_prod) {
accessforbidden(); accessforbidden();
} }
/*
* View
*/
llxHeader('', 'Documentation and examples for theme'); llxHeader('', 'Documentation and examples for theme');
?> ?>
<main role="main" > <main role="main" >

View File

@ -22,19 +22,22 @@ if (!defined("NOLOGIN")) {
define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
} }
require '../../main.inc.php'; require '../../main.inc.php';
// Security
if ($dolibarr_main_prod) { if ($dolibarr_main_prod) {
accessforbidden(); accessforbidden();
} }
$usedolheader = 1; // 1 = Test inside a dolibarr page, 0 = Use hard coded header
/*
* View
*/
$form = new Form($db); $form = new Form($db);
$usedolheader = 1; // 1 = Test inside a dolibarr page, 0 = Use hard coded header
// HEADER // HEADER
//-------- //--------

View File

@ -1,5 +1,38 @@
<?php <?php
//define("NOLOGIN",1); // This means this output page does not require to be logged.
//if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1');
//if (!defined('NOREQUIREDB')) define('NOREQUIREDB', '1');
if (!defined('NOREQUIRESOC')) {
define('NOREQUIRESOC', '1');
}
//if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
if (!defined('NOSTYLECHECK')) {
define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
}
if (!defined('NOCSRFCHECK')) {
define('NOCSRFCHECK', '1'); // Do not check anti CSRF attack test
}
if (!defined('NOTOKENRENEWAL')) {
define('NOTOKENRENEWAL', '1'); // Do not check anti POST attack test
}
//if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
//if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
//if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
if (!defined("NOLOGIN")) {
define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
}
require '../../main.inc.php';
// Security
if ($dolibarr_main_prod) {
accessforbidden();
}
/*
* View
*/
?> ?>

View File

@ -0,0 +1,87 @@
<?php
if (!defined('NOREQUIREUSER')) {
define('NOREQUIREUSER', '1');
}
if (!defined('NOREQUIREDB')) {
define('NOREQUIREDB', '1');
}
if (!defined('NOREQUIRESOC')) {
define('NOREQUIRESOC', '1');
}
if (!defined('NOREQUIRETRAN')) {
define('NOREQUIRETRAN', '1');
}
if (!defined('NOSTYLECHECK')) {
define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
}
if (!defined('NOCSRFCHECK')) {
define('NOCSRFCHECK', '1'); // Do not check anti CSRF attack test
}
if (!defined('NOTOKENRENEWAL')) {
define('NOTOKENRENEWAL', '1'); // Do not check anti POST attack test
}
if (!defined('NOREQUIREMENU')) {
define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
}
if (!defined('NOREQUIREHTML')) {
define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
}
if (!defined('NOREQUIREAJAX')) {
define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
}
if (!defined("NOLOGIN")) {
define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
}
// If you don't need session management (can't be logged if no session used). You must also set
// NOCSRFCHECK, NOTOKENRENEWAL, NOLOGIN
// Disable module with GETPOST('disablemodules') won't work. Variable 'dol_...' will not be set.
// $_SESSION are then simple vars if sessions are not active.
// TODO We can close session with session_write_close() as soon as we just need read access everywhere in code.
if (!defined("NOSESSION")) {
define("NOSESSION", '1');
}
print "Legend:<br>\n";
print 'PHP_SESSION_DISABLED='.PHP_SESSION_DISABLED."<br>\n";
print 'PHP_SESSION_NONE='.PHP_SESSION_NONE."<br>\n";
print 'PHP_SESSION_ACTIVE='.PHP_SESSION_ACTIVE."<br>\n";
print '<br>';
print 'session_status='.session_status().' (before main.inc.php)';
print '<br>';
require '../../main.inc.php';
// Security
if ($dolibarr_main_prod) {
accessforbidden();
}
/*
* View
*/
echo "Test<br>\n";
$out='';
$ret=0;
$file = '/tmp/aaa';
$f=fopen($file, 'r');
if ($f) {
$s=fread($f, 4096);
print $s;
fclose($f);
} else {
print "Failed to open file ".$file."<br>\n";
}
exec('cat /aaa; ls /dev/std*; sleep 1;', $out, $ret);
print $ret."<br>\n";
print_r($out);
$ret = 0;
$out = null;
exec('/usr/bin/clamdscan --fdpass filethatdoesnotexists.php', $out, $ret);
print $ret."<br>\n";
print_r($out);

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