diff --git a/ChangeLog b/ChangeLog index a8211da486a..0f568ff5359 100644 --- a/ChangeLog +++ b/ChangeLog @@ -109,6 +109,13 @@ NEW: External backups can be downloaded from the "About info page". NEW: Add massaction to switch status on sale / on purchase of a product. + Modules +NEW: Stable module Knowledge Management +NEW: Experimental module Event Organization Management +NEW: Experimental module Workstations Management +NEW: Development of module Partnership Management + + For developers: --------------- diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 06309a2706e..8edc61bf255 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/eventorganization.lib.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Translations -$langs->loadLangs(array("admin", "eventorganization")); +$langs->loadLangs(array("admin", "eventorganization", "categories")); // Parameters $action = GETPOST('action', 'aZ09'); @@ -54,11 +54,11 @@ $arrayofparameters = array( 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), - 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), - 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), - 'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1), + //'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), + //'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), 'SERVICE_BOOTH_LOCATION'=>array('type'=>'product', 'enabled'=>1), 'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION'=>array('type'=>'product', 'enabled'=>1), + 'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1), ); $error = 0; diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 0b9272c2418..36be1f273ff 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -137,7 +137,7 @@ $dirtocompress = basename($fulldirtocompress); if ($compression == 'zip') { $file .= '.zip'; - $excludefiles = '/(\.back|\.old|\.log|[\/\\\]temp[\/\\\]|documents[\/\\\]admin[\/\\\]documents[\/\\\])/i'; + $excludefiles = '/(\.back|\.old|\.log|\.pdf_preview-.*\.png|[\/\\\]temp[\/\\\]|documents[\/\\\]admin[\/\\\]documents[\/\\\])/i'; //var_dump($fulldirtocompress); //var_dump($outputdir."/".$file);exit; @@ -173,7 +173,7 @@ if ($compression == 'zip') { // 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))."'"; + $cmd = "tar -cf ".escapeshellcmd($outputdir."/".$file)." --exclude-vcs --exclude-caches-all --exclude='temp' --exclude='*.log' --exclude='*.pdf_preview-*.png' --exclude='documents/admin/documents' -C '".escapeshellcmd(dol_sanitizePathName($dirtoswitch))."' '".escapeshellcmd(dol_sanitizeFileName($dirtocompress))."'"; $result = $utils->executeCLI($cmd, $outputfile, 0, null, 1); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 5f161f88bfb..602897d34f9 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -81,7 +81,7 @@ if (!$error && $massaction == 'confirm_presend') { $listofobjectref = array(); $contactidtosend = array(); $attachedfilesThirdpartyObj = array(); - $oneemailperrecipient = (GETPOST('oneemailperrecipient') == 'on' ? 1 : 0); + $oneemailperrecipient = (GETPOST('oneemailperrecipient', 'int') ? 1 : 0); if (!$error) { $thirdparty = new Societe($db); diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index 43ddd23f13d..fbf526fd58e 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -29,13 +29,13 @@ // $formSetup may be defined -if ($action == 'update' && !empty($formSetup) && is_object($formSetup)) { +if ($action == 'update' && !empty($formSetup) && is_object($formSetup) && !empty($user->admin)) { $formSetup->saveConfFromPost(); return; } -if ($action == 'update' && is_array($arrayofparameters)) { +if ($action == 'update' && is_array($arrayofparameters) && !empty($user->admin)) { $db->begin(); foreach ($arrayofparameters as $key => $val) { @@ -72,8 +72,37 @@ if ($action == 'update' && is_array($arrayofparameters)) { } } +if ($action == 'deletefile' && $modulepart == 'doctemplates' && !empty($user->admin)) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $keyforuploaddir = GETPOST('keyforuploaddir', 'aZ09'); + + $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim(getDolGlobalString($keyforuploaddir)))); + foreach ($listofdir as $key => $tmpdir) { + $tmpdir = preg_replace('/DOL_DATA_ROOT\/*/', '', $tmpdir); // Clean string if we found a hardcoded DOL_DATA_ROOT + if (!$tmpdir) { + unset($listofdir[$key]); + continue; + } + $tmpdir = DOL_DATA_ROOT.'/'.$tmpdir; // Complete with DOL_DATA_ROOT. Only files into DOL_DATA_ROOT can be reach/set + if (!is_dir($tmpdir)) { + if (empty($nomessageinsetmoduleoptions)) { + setEventMessages($langs->trans("ErrorDirNotFound", $tmpdir), null, 'warnings'); + } + } else { + $upload_dir = $tmpdir; + break; // So we take the first directory found into setup $conf->global->$keyforuploaddir + } + } + + $filetodelete = $tmpdir.'/'.GETPOST('file'); + $result = dol_delete_file($filetodelete); + if ($result > 0) { + setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs'); + } +} + // Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) -if ($action == 'setModuleOptions') { +if ($action == 'setModuleOptions' && !empty($user->admin)) { $db->begin(); // Process common param fields @@ -97,20 +126,22 @@ if ($action == 'setModuleOptions') { if (GETPOST('upload', 'alpha') && GETPOST('keyforuploaddir', 'aZ09')) { include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $keyforuploaddir = GETPOST('keyforuploaddir', 'aZ09'); - $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->$keyforuploaddir))); + $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim(getDolGlobalString($keyforuploaddir)))); foreach ($listofdir as $key => $tmpdir) { $tmpdir = trim($tmpdir); - $tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir); + $tmpdir = preg_replace('/DOL_DATA_ROOT\/*/', '', $tmpdir); // Clean string if we found a hardcoded DOL_DATA_ROOT if (!$tmpdir) { unset($listofdir[$key]); continue; } + $tmpdir = DOL_DATA_ROOT.'/'.$tmpdir; // Complete with DOL_DATA_ROOT. Only files into DOL_DATA_ROOT can be reach/set if (!is_dir($tmpdir)) { if (empty($nomessageinsetmoduleoptions)) { setEventMessages($langs->trans("ErrorDirNotFound", $tmpdir), null, 'warnings'); } } else { $upload_dir = $tmpdir; + break; // So we take the first directory found into setup $conf->global->$keyforuploaddir } } if ($upload_dir) { diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index 574ee7b7d80..e57bb1f14d9 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -26,6 +26,7 @@ */ include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; + /** * Class to manage the box to show last projet */ @@ -63,7 +64,7 @@ class box_validated_projects extends ModeleBoxes $langs->loadLangs(array('boxes', 'projects')); $this->db = $db; - $this->boxlabel = "ProjectsWithTask"; + $this->boxlabel = "ProjectTasksWithoutTimeSpent"; $this->hidden = !($user->rights->projet->lire); @@ -116,7 +117,7 @@ class box_validated_projects extends ModeleBoxes $sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_contact as ec ON ec.element_id = t.rowid AND fk_c_type_contact IN (-1, -2, -3)"; $sql .= " WHERE p.fk_statut = 1"; // Only open projects if ($projectsListId) { - $sql .= ' AND p.rowid IN ('.$this->db->sanitize($projectsListId).')'; // Only project are allowed + $sql .= ' AND p.rowid IN ('.$this->db->sanitize($projectsListId).')'; // Only projects that are allowed } $sql .= " AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_user = ".((int) $user->id).")"; $sql .= " GROUP BY p.rowid, p.ref, p.fk_soc, p.dateo"; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 3539348e35a..b848e04b061 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -379,9 +379,10 @@ class FormFile * @param Object $object Object when method is called from an object card. * @param int $hideifempty Hide section of generated files if there is no file * @param string $removeaction (optional) The action to remove a file + * @param string $tooltipontemplatecombo Text to show on a tooltip after the combo list of templates * @return string Output string with HTML array of documents (might be empty string) */ - public function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '', $morepicto = '', $object = null, $hideifempty = 0, $removeaction = 'remove_file') + public function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '', $morepicto = '', $object = null, $hideifempty = 0, $removeaction = 'remove_file', $tooltipontemplatecombo = '') { global $dolibarr_main_url_root; @@ -769,6 +770,7 @@ class FormFile if ($conf->use_javascript_ajax) { $out .= ajax_combobox('model'); } + $out .= $form->textwithpicto('', $tooltipontemplatecombo, 1, 'help', 'marginrightonly', 0, 3, '', 0); } else { $out .= '
| '; - $out .= $langs->trans("GroupEmails"); - $out .= ' | '; - $out .= ' withoptiononeemailperrecipient > 0 ? ' checked="checked"' : '').'> '; - $out .= ''; - $out .= ''; - $out .= ' - '; - $out .= $langs->trans("WarningIfYouCheckOneRecipientPerEmail"); - $out .= ''; - $out .= ' |
| '; + $out .= $langs->trans("GroupEmails"); + $out .= ' | '; + $out .= ' withoptiononeemailperrecipient > 0 ? ' checked="checked"' : '').'> '; + $out .= ''; + $out .= ''; + $out .= ' - '; + $out .= $langs->trans("WarningIfYouCheckOneRecipientPerEmail"); + $out .= ''; + $out .= ' |
| ';
print price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency);
$total_budget_amount += $lines[$i]->budget_amount;
diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php
index 6ab1c8acb89..96ee96efae2 100644
--- a/htdocs/core/modules/modEventOrganization.class.php
+++ b/htdocs/core/modules/modEventOrganization.class.php
@@ -55,7 +55,7 @@ class modEventOrganization extends DolibarrModules
$this->description = "EventOrganizationDescription";
$this->descriptionlong = "EventOrganizationDescriptionLong";
- $this->version = 'development';
+ $this->version = 'experimental';
// Key used in llx_const table to save module status enabled/disabled (where EVENTORGANIZATION is value of property name of module in uppercase)
diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
index 7ad49fdb01e..7fff122ec57 100644
--- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
+++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
@@ -170,7 +170,10 @@ class doc_generic_product_odt extends ModelePDFProduct
$texte .= ' ';
// Show list of found files
foreach ($listoffiles as $file) {
- $texte .= '- '.$file['name'].' '.img_picto('', 'listlight').' ';
}
diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
index 3a7c8447775..aaa9c03c6e7 100644
--- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
+++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
@@ -102,12 +102,13 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$form = new Form($this->db);
$texte = $this->description.".'; + $texte .= '- '.$file['name']; + $texte .= ' '.img_picto('', 'listlight').''; + $texte .= ' '.img_picto('', 'delete').''; + $texte .= ' '; } $texte .= ' \n"; + $texte .= ''; $texte .= ' |