Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2022-01-22 17:27:57 +01:00
commit a16293f9b7
31 changed files with 265 additions and 245 deletions

View File

@ -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. 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: For developers:
--------------- ---------------

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/eventorganization.lib.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
// Translations // Translations
$langs->loadLangs(array("admin", "eventorganization")); $langs->loadLangs(array("admin", "eventorganization", "categories"));
// Parameters // Parameters
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
@ -54,11 +54,11 @@ $arrayofparameters = array(
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), '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_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>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_SPEAKER'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), //'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1),
'SERVICE_BOOTH_LOCATION'=>array('type'=>'product', 'enabled'=>1), 'SERVICE_BOOTH_LOCATION'=>array('type'=>'product', 'enabled'=>1),
'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION'=>array('type'=>'product', 'enabled'=>1), 'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION'=>array('type'=>'product', 'enabled'=>1),
'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1),
); );
$error = 0; $error = 0;

View File

@ -137,7 +137,7 @@ $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|\.pdf_preview-.*\.png|[\/\\\]temp[\/\\\]|documents[\/\\\]admin[\/\\\]documents[\/\\\])/i';
//var_dump($fulldirtocompress); //var_dump($fulldirtocompress);
//var_dump($outputdir."/".$file);exit; //var_dump($outputdir."/".$file);exit;
@ -173,7 +173,7 @@ if ($compression == 'zip') {
// We also exclude '/temp/' dir and 'documents/admin/documents' // 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. // 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); $result = $utils->executeCLI($cmd, $outputfile, 0, null, 1);

View File

@ -81,7 +81,7 @@ if (!$error && $massaction == 'confirm_presend') {
$listofobjectref = array(); $listofobjectref = array();
$contactidtosend = array(); $contactidtosend = array();
$attachedfilesThirdpartyObj = array(); $attachedfilesThirdpartyObj = array();
$oneemailperrecipient = (GETPOST('oneemailperrecipient') == 'on' ? 1 : 0); $oneemailperrecipient = (GETPOST('oneemailperrecipient', 'int') ? 1 : 0);
if (!$error) { if (!$error) {
$thirdparty = new Societe($db); $thirdparty = new Societe($db);

View File

@ -26,6 +26,7 @@
*/ */
include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
/** /**
* Class to manage the box to show last projet * Class to manage the box to show last projet
*/ */
@ -63,7 +64,7 @@ class box_validated_projects extends ModeleBoxes
$langs->loadLangs(array('boxes', 'projects')); $langs->loadLangs(array('boxes', 'projects'));
$this->db = $db; $this->db = $db;
$this->boxlabel = "ProjectsWithTask"; $this->boxlabel = "ProjectTasksWithoutTimeSpent";
$this->hidden = !($user->rights->projet->lire); $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 .= " 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 $sql .= " WHERE p.fk_statut = 1"; // Only open projects
if ($projectsListId) { 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 .= " 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"; $sql .= " GROUP BY p.rowid, p.ref, p.fk_soc, p.dateo";

View File

@ -157,6 +157,7 @@ class FormMail extends Form
public $lines_model; public $lines_model;
// -1 suggest the checkbox 'one email per recipient' not checked, 0 = no suggestion, 1 = suggest and checked
public $withoptiononeemailperrecipient; public $withoptiononeemailperrecipient;
@ -357,7 +358,7 @@ class FormMail extends Form
// phpcs:enable // phpcs:enable
global $conf, $langs, $user, $hookmanager, $form; global $conf, $langs, $user, $hookmanager, $form;
// Required to show preview of mail attachments // Required to show preview wof mail attachments
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$formfile = new Formfile($this->db); $formfile = new Formfile($this->db);
@ -366,7 +367,7 @@ class FormMail extends Form
} }
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('other', 'mails')); $langs->loadLangs(array('other', 'mails', 'members'));
// Clear temp files. Must be done before call of triggers, at beginning (mode = init), or when we select a new template // Clear temp files. Must be done before call of triggers, at beginning (mode = init), or when we select a new template
if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelselected') && GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) { if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelselected') && GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) {
@ -464,11 +465,10 @@ class FormMail extends Form
$modelmail_array = array(); $modelmail_array = array();
if ($this->param['models'] != 'none') { if ($this->param['models'] != 'none') {
$result = $this->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs); $result = $this->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs);
if ($result < 0) { if ($result < 0) {
setEventMessages($this->error, $this->errors, 'errors'); setEventMessages($this->error, $this->errors, 'errors');
} }
$langs->trans("members");
foreach ($this->lines_model as $line) { foreach ($this->lines_model as $line) {
$reg = array(); $reg = array();
if (preg_match('/\((.*)\)/', $line->label, $reg)) { if (preg_match('/\((.*)\)/', $line->label, $reg)) {
@ -503,7 +503,7 @@ class FormMail extends Form
} }
$out .= ' &nbsp; '; $out .= ' &nbsp; ';
$out .= '<input type="submit" class="button" value="'.$langs->trans('Apply').'" name="modelselected" id="modelselected">'; $out .= '<input type="submit" class="button reposition" value="'.$langs->trans('Apply').'" name="modelselected" id="modelselected">';
$out .= ' &nbsp; '; $out .= ' &nbsp; ';
$out .= '</div>'; $out .= '</div>';
} elseif (!empty($this->param['models']) && in_array($this->param['models'], array( } elseif (!empty($this->param['models']) && in_array($this->param['models'], array(
@ -526,7 +526,7 @@ class FormMail extends Form
} }
$out .= '<table class="tableforemailform boxtablenotop" width="100%">'."\n"; $out .= '<table class="tableforemailform boxtablenotop centpercent">'."\n";
// Substitution array/string // Substitution array/string
$helpforsubstitution = ''; $helpforsubstitution = '';
@ -688,16 +688,20 @@ class FormMail extends Form
// With option one email per recipient // With option one email per recipient
if (!empty($this->withoptiononeemailperrecipient)) { if (!empty($this->withoptiononeemailperrecipient)) {
$out .= '<tr><td class="minwidth200">'; if (abs($this->withoptiononeemailperrecipient) == 1) {
$out .= $langs->trans("GroupEmails"); $out .= '<tr><td class="minwidth200">';
$out .= '</td><td>'; $out .= $langs->trans("GroupEmails");
$out .= ' <input type="checkbox" id="oneemailperrecipient" name="oneemailperrecipient"'.($this->withoptiononeemailperrecipient > 0 ? ' checked="checked"' : '').'> '; $out .= '</td><td>';
$out .= '<label for="oneemailperrecipient">'.$langs->trans("OneEmailPerRecipient").'</label>'; $out .= ' <input type="checkbox" id="oneemailperrecipient" value="1" name="oneemailperrecipient"'.($this->withoptiononeemailperrecipient > 0 ? ' checked="checked"' : '').'> ';
$out .= '<span class="hideonsmartphone opacitymedium">'; $out .= '<label for="oneemailperrecipient">'.$langs->trans("OneEmailPerRecipient").'</label>';
$out .= ' - '; $out .= '<span class="hideonsmartphone opacitymedium">';
$out .= $langs->trans("WarningIfYouCheckOneRecipientPerEmail"); $out .= ' - ';
$out .= '</span>'; $out .= $langs->trans("WarningIfYouCheckOneRecipientPerEmail");
$out .= '</td></tr>'; $out .= '</span>';
$out .= '</td></tr>';
} else {
$out .= '<tr><td><input type="hidden" name="oneemailperrecipient" value="1"></td><td></td></tr>';
}
} }
// CC // CC
@ -813,8 +817,7 @@ class FormMail extends Form
$out .= '<br></div>'; $out .= '<br></div>';
} }
} elseif (empty($this->withmaindocfile)) { } elseif (empty($this->withmaindocfile)) {
// Do not show message if we asked to show the checkbox $out .= '<span class="opacitymedium">'.$langs->trans("NoAttachedFiles").'</span><br>';
$out .= $langs->trans("NoAttachedFiles").'<br>';
} }
if ($this->withfile == 2) { if ($this->withfile == 2) {
// Can add other files // Can add other files
@ -1217,6 +1220,7 @@ class FormMail extends Form
global $conf, $langs, $form; global $conf, $langs, $form;
$defaulttopic = GETPOST('subject', 'restricthtml'); $defaulttopic = GETPOST('subject', 'restricthtml');
if (!GETPOST('modelselected', 'alpha') || GETPOST('modelmailselected') != '-1') { if (!GETPOST('modelselected', 'alpha') || GETPOST('modelmailselected') != '-1') {
if ($arraydefaultmessage && $arraydefaultmessage->topic) { if ($arraydefaultmessage && $arraydefaultmessage->topic) {
$defaulttopic = $arraydefaultmessage->topic; $defaulttopic = $arraydefaultmessage->topic;

View File

@ -823,7 +823,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
} }
} }
if (count($arrayfields) > 0 && !empty($arrayfields['c.budget_amount']['checked'])) { if (count($arrayfields) > 0 && !empty($arrayfields['t.budget_amount']['checked'])) {
print '<td class="center">'; print '<td class="center">';
print price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); print price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency);
$total_budget_amount += $lines[$i]->budget_amount; $total_budget_amount += $lines[$i]->budget_amount;

View File

@ -55,7 +55,7 @@ class modEventOrganization extends DolibarrModules
$this->description = "EventOrganizationDescription"; $this->description = "EventOrganizationDescription";
$this->descriptionlong = "EventOrganizationDescriptionLong"; $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) // Key used in llx_const table to save module status enabled/disabled (where EVENTORGANIZATION is value of property name of module in uppercase)

View File

@ -170,7 +170,10 @@ class doc_generic_product_odt extends ModelePDFProduct
$texte .= '<div id="div_'.get_class($this).'" class="hiddenx">'; $texte .= '<div id="div_'.get_class($this).'" class="hiddenx">';
// Show list of found files // Show list of found files
foreach ($listoffiles as $file) { foreach ($listoffiles as $file) {
$texte .= '- '.$file['name'].' <a href="'.DOL_URL_ROOT.'/document.php?modulepart=doctemplates&file=products/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a><br>'; $texte .= '- '.$file['name'];
$texte .= ' <a href="'.DOL_URL_ROOT.'/document.php?modulepart=doctemplates&file=products/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a>';
$texte .= ' &nbsp; <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?modulepart=doctemplates&keyforuploaddir=PRODUCT_ADDON_PDF_ODT_PATH&action=deletefile&token='.newToken().'&file='.urlencode(basename($file['name'])).'">'.img_picto('', 'delete').'</a>';
$texte .= '<br>';
} }
$texte .= '</div>'; $texte .= '</div>';
} }

View File

@ -163,7 +163,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
// Show list of found files // Show list of found files
foreach ($listoffiles as $file) { foreach ($listoffiles as $file) {
$texte .= '- '.$file['name'].' &nbsp; <a class="reposition" href="'.DOL_URL_ROOT.'/document.php?modulepart=doctemplates&file=thirdparties/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a>'; $texte .= '- '.$file['name'].' &nbsp; <a class="reposition" href="'.DOL_URL_ROOT.'/document.php?modulepart=doctemplates&file=thirdparties/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a>';
$texte .= ' &nbsp; <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?modulepart=doctemplates&keyforuploaddir=COMPANY_ADDON_PDF_ODT_PATH&action=deletefile&file='.urlencode(basename($file['name'])).'">'.img_picto('', 'delete').'</a>'; $texte .= ' &nbsp; <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?modulepart=doctemplates&keyforuploaddir=COMPANY_ADDON_PDF_ODT_PATH&action=deletefile&token='.newToken().'&file='.urlencode(basename($file['name'])).'">'.img_picto('', 'delete').'</a>';
$texte .= '<br>'; $texte .= '<br>';
} }
$texte .= '</div>'; $texte .= '</div>';

View File

@ -19,12 +19,17 @@
*/ */
// Following var must be set: // Following var must be set:
// $action
// $arrayofselected = array of id selected // $arrayofselected = array of id selected
// $object // $objecttmp = new MyObject($db);
// $objecttmp=new Propal($db);
// $topicmail="SendSupplierProposalRef"; // $topicmail="SendSupplierProposalRef";
// $modelmail="supplier_proposal_send"; // $modelmail="supplier_proposal_send";
// $trackid='ord'.$object->id; // $trackid='ord'.$objecttmp->id;
//
// Following var can be set
// $object = Object fetched;
// $sendto
// $withmaindocfilemail
if ($massaction == 'predeletedraft') { if ($massaction == 'predeletedraft') {
@ -41,6 +46,7 @@ if ($massaction == 'preaffecttag') {
$categ_types = array(); $categ_types = array();
$categ_type_array = $categ->getMapList(); $categ_type_array = $categ->getMapList();
foreach ($categ_type_array as $categdef) { foreach ($categ_type_array as $categdef) {
// Test on $object (should be useless, we already check on $objecttmp just after)
if (isset($object) && $categdef['obj_table'] == $object->table_element) { if (isset($object) && $categdef['obj_table'] == $object->table_element) {
if (!array_key_exists($categdef['code'], $categ_types)) { if (!array_key_exists($categdef['code'], $categ_types)) {
$categ_types[$categdef['code']] = array('code'=>$categdef['code'], 'label'=>$langs->trans($categdef['obj_class'])); $categ_types[$categdef['code']] = array('code'=>$categdef['code'], 'label'=>$langs->trans($categdef['obj_class']));
@ -76,7 +82,7 @@ if ($massaction == 'presend') {
$langs->load("mails"); $langs->load("mails");
$listofselectedid = array(); $listofselectedid = array();
$listofselectedthirdparties = array(); $listofselectedrecipientobjid = array();
$listofselectedref = array(); $listofselectedref = array();
if (!GETPOST('cancel', 'alpha')) { if (!GETPOST('cancel', 'alpha')) {
@ -84,14 +90,19 @@ if ($massaction == 'presend') {
$result = $objecttmp->fetch($toselectid); $result = $objecttmp->fetch($toselectid);
if ($result > 0) { if ($result > 0) {
$listofselectedid[$toselectid] = $toselectid; $listofselectedid[$toselectid] = $toselectid;
$thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); $thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); // For proposal, order, invoice, conferenceorbooth, ...
if ($objecttmp->element == 'societe') { if (in_array($objecttmp->element, array('societe', 'conferenceorboothattendee'))) {
$thirdpartyid = $objecttmp->id; $thirdpartyid = $objecttmp->id;
} }
if ($objecttmp->element == 'expensereport') { if ($objecttmp->element == 'expensereport') {
$thirdpartyid = $objecttmp->fk_user_author; $thirdpartyid = $objecttmp->fk_user_author;
} }
$listofselectedthirdparties[$thirdpartyid] = $thirdpartyid; if (empty($thirdpartyid)) {
$thirdpartyid = 0;
}
if ($thirdpartyid) {
$listofselectedrecipientobjid[$thirdpartyid] = $thirdpartyid;
}
$listofselectedref[$thirdpartyid][$toselectid] = $objecttmp->ref; $listofselectedref[$thirdpartyid][$toselectid] = $objecttmp->ref;
} }
} }
@ -113,9 +124,9 @@ if ($massaction == 'presend') {
$formmail->trackid = $trackid; $formmail->trackid = $trackid;
$formmail->withfrom = 1; $formmail->withfrom = 1;
$liste = $langs->trans("AllRecipientSelected", count($arrayofselected)); $liste = $langs->trans("AllRecipientSelected", count($arrayofselected));
if (count($listofselectedthirdparties) == 1) { // Only 1 different recipient selected, we can suggest contacts if (count($listofselectedrecipientobjid) == 1) { // Only 1 different recipient selected, we can suggest contacts
$liste = array(); $liste = array();
$thirdpartyid = array_shift($listofselectedthirdparties); $thirdpartyid = array_shift($listofselectedrecipientobjid);
if ($objecttmp->element == 'expensereport') { if ($objecttmp->element == 'expensereport') {
$fuser = new User($db); $fuser = new User($db);
$fuser->fetch($thirdpartyid); $fuser->fetch($thirdpartyid);
@ -136,19 +147,31 @@ if ($massaction == 'presend') {
$formmail->withtoreadonly = 1; $formmail->withtoreadonly = 1;
} }
$formmail->withoptiononeemailperrecipient = ((count($listofselectedref) == 1 && count(reset($listofselectedref)) == 1) || empty($liste)) ? 0 : ((GETPOST('oneemailperrecipient') == 'on') ? 1 : -1);
$formmail->withoptiononeemailperrecipient = ((count($listofselectedref) == 1 && count(reset($listofselectedref)) == 1) || empty($liste)) ? 0 : (GETPOST('oneemailperrecipient', 'int') ? 1 : -1);
if (in_array($objecttmp->element, array('conferenceorboothattendee'))) {
$formmail->withoptiononeemailperrecipient = 0;
}
$formmail->withto = empty($liste) ? (GETPOST('sendto', 'alpha') ?GETPOST('sendto', 'alpha') : array()) : $liste; $formmail->withto = empty($liste) ? (GETPOST('sendto', 'alpha') ?GETPOST('sendto', 'alpha') : array()) : $liste;
$formmail->withtofree = empty($liste) ? 1 : 0; $formmail->withtofree = empty($liste) ? 1 : 0;
$formmail->withtocc = 1; $formmail->withtocc = 1;
$formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC;
$formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REF_CLIENT__'); if (!empty($topicmail)) {
$formmail->withfile = 1; $formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REF_CLIENT__');
// $formmail->withfile = 2; Not yet supported in mass action } else {
$formmail->withmaindocfile = 1; // Add a checkbox "Attach also main document" $formmail->withtopic = 1;
if ($objecttmp->element != 'societe') { }
$formmail->withfile = '<span class="hideonsmartphone opacitymedium">'.$langs->trans("OnlyPDFattachmentSupported").'</span>'; $formmail->withfile = 1; // $formmail->withfile = 2 to allow to upload files is not yet supported in mass action
$formmail->withmaindocfile = - 1; // Add a checkbox "Attach also main document" but not checked by default // Add a checkbox "Attach also main document"
if (isset($withmaindocfilemail)) {
$formmail->withmaindocfile = $withmaindocfilemail;
} else { // Do an automatic definition of $formmail->withmaindocfile
$formmail->withmaindocfile = 1;
if ($objecttmp->element != 'societe') {
$formmail->withfile = '<span class="hideonsmartphone opacitymedium">'.$langs->trans("OnlyPDFattachmentSupported").'</span>';
$formmail->withmaindocfile = -1; // Add a checkbox "Attach also main document" but not checked by default
}
} }
$formmail->withbody = 1; $formmail->withbody = 1;
$formmail->withdeliveryreceipt = 1; $formmail->withdeliveryreceipt = 1;
@ -167,16 +190,16 @@ if ($massaction == 'presend') {
); );
complete_substitutions_array($substitutionarray, $langs, $object, $parameters); complete_substitutions_array($substitutionarray, $langs, $object, $parameters);
// Tableau des substitutions // Array of substitutions
$formmail->substit = $substitutionarray; $formmail->substit = $substitutionarray;
// Tableau des parametres complementaires du post // Tableau des parametres complementaires du post
$formmail->param['action'] = $action; $formmail->param['action'] = $action;
$formmail->param['models'] = $modelmail; $formmail->param['models'] = $modelmail; // the filter to know which kind of template emails to show. 'none' means no template suggested.
$formmail->param['models_id'] = GETPOST('modelmailselected', 'int'); $formmail->param['models_id'] = GETPOST('modelmailselected', 'int') ? GETPOST('modelmailselected', 'int') : '-1';
$formmail->param['id'] = join(',', $arrayofselected); $formmail->param['id'] = join(',', $arrayofselected);
// $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; // $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedthirdparties) > $conf->global->MAILING_LIMIT_SENDBYWEB) { if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedrecipientobjid) > $conf->global->MAILING_LIMIT_SENDBYWEB) {
$langs->load("errors"); $langs->load("errors");
print img_warning().' '.$langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB); print img_warning().' '.$langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB);
print ' - <a href="javascript: window.history.go(-1)">'.$langs->trans("GoBack").'</a>'; print ' - <a href="javascript: window.history.go(-1)">'.$langs->trans("GoBack").'</a>';

View File

@ -621,8 +621,8 @@ $arrayofmassactions = array(
//'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
//'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("ConferenceOrBooth"), 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' ('.$langs->trans("ToSpeakers").')',
'presend_attendees'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("Attendees"), //'presend_attendees'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("Attendees"),
); );
if ($permissiontodelete) { if ($permissiontodelete) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
@ -650,12 +650,13 @@ $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle'
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
// Add code for pre mass action (confirmation or email presend form) // Add code for pre mass action (confirmation or email presend form)
$topicmail = $object->ref; $topicmail = $projectstatic->title;
$modelmail = "conferenceorbooth"; $modelmail = "conferenceorbooth";
$objecttmp = new ConferenceOrBooth($db); $objecttmp = new ConferenceOrBooth($db);
$trackid = 'conferenceorbooth_'.$object->id; $trackid = 'conferenceorbooth_'.$object->id;
include DOL_DOCUMENT_ROOT.'/eventorganization/tpl/massactions_mail_pre.tpl.php'; $withmaindocfilemail = 0;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
@ -689,6 +690,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";

View File

@ -182,8 +182,8 @@ if (GETPOST('cancel', 'alpha')) {
$massaction = ''; $massaction = '';
} }
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend'
&& $massaction != 'presend_attendees' && $massaction != 'presend'
&& $massaction != 'confirm_presend_attendees') { && $massaction != 'confirm_presend') {
$massaction = ''; $massaction = '';
} }
@ -676,8 +676,7 @@ $arrayofmassactions = array(
//'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
//'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
'presend_attendees'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("Attendees"),
); );
if ($permissiontodelete) { if ($permissiontodelete) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
@ -706,14 +705,16 @@ $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle'
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
// Add code for pre mass action (confirmation or email presend form) // Add code for pre mass action (confirmation or email presend form)
$topicmail = "SendConferenceOrBoothAttendeeRef"; $topicmail = $projectstatic->title;
$modelmail = "conferenceorboothattendee"; $modelmail = "conferenceorbooth";
$objecttmp = new ConferenceOrBoothAttendee($db); $objecttmp = new ConferenceOrBoothAttendee($db);
$trackid = 'xxxx'.$object->id; $trackid = 'conferenceorbooth_'.$object->id;
include DOL_DOCUMENT_ROOT.'/eventorganization/tpl/massactions_mail_pre.tpl.php'; $withmaindocfilemail = 0;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($search_all) { if ($search_all) {
foreach ($fieldstosearchall as $key => $val) { foreach ($fieldstosearchall as $key => $val) {
$fieldstosearchall[$key] = $langs->trans($val); $fieldstosearchall[$key] = $langs->trans($val);

View File

@ -78,7 +78,7 @@ if (!$error && $massaction == 'confirm_presend_attendees') {
$listofobjectid = array(); $listofobjectid = array();
$listofobjectref = array(); $listofobjectref = array();
$oneemailperrecipient = (GETPOST('oneemailperrecipient') == 'on' ? 1 : 0); $oneemailperrecipient = (GETPOST('oneemailperrecipient', 'int') ? 1 : 0);
if (!$error) { if (!$error) {
require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorboothattendee.class.php'; require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorboothattendee.class.php';

View File

@ -1,126 +0,0 @@
<?php
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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/>.
* or see https://www.gnu.org/
*/
// Following var must be set:
// $arrayofselected = array of id selected
// $object
// $objecttmp=new Propal($db);
// $topicmail="SendSupplierProposalRef";
// $modelmail="supplier_proposal_send";
// $trackid='ord'.$object->id;
if ($massaction == 'presend_attendees') {
$langs->load("mails");
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
$attendee = new ConferenceOrBoothAttendee($db);
$listofselectedid = array();
$listofselectedref = array();
if (!GETPOST('cancel', 'alpha')) {
foreach ($arrayofselected as $toselectid) {
$result = $objecttmp->fetch($toselectid);
if ($result > 0) {
$attendees = $attendee->fetchAll();
if (is_array($attendees) && count($attendees)>0) {
foreach ($attendees as $attmail) {
if (!empty($attmail->email)) {
$listofselectedid[$attmail->email] = $attmail->id;
$listofselectedref[$attmail->id][$toselectid] = $objecttmp->ref;
}
}
}
}
}
}
print '<input type="hidden" name="massaction" value="confirm_presend_attendees">';
print '<input type="hidden" name="projectid" value="'.GETPOST('projectid', 'int').'">';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
print dol_get_fiche_head(null, '', '');
// Create form for email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->withform = -1;
$formmail->fromtype = (GETPOST('fromtype') ? GETPOST('fromtype') : (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user'));
if ($formmail->fromtype === 'user') {
$formmail->fromid = $user->id;
}
$formmail->trackid = $trackid;
$formmail->withfrom = 1;
$liste = $langs->trans("AllRecipientSelected", count($listofselectedid));
$formmail->withtoreadonly = 1;
$formmail->withoptiononeemailperrecipient = ((count($listofselectedref) == 1 && count(reset($listofselectedref)) == 1) || empty($liste)) ? 0 : ((GETPOST('oneemailperrecipient') == 'on') ? 1 : -1);
$formmail->withto = empty($liste) ? (GETPOST('sendto', 'alpha') ?GETPOST('sendto', 'alpha') : array()) : $liste;
$formmail->withtofree = empty($liste) ? 1 : 0;
$formmail->withtocc = 1;
$formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC;
$formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REF_CLIENT__');
$formmail->withfile = 0;
// $formmail->withfile = 2; Not yet supported in mass action
$formmail->withmaindocfile = 0; // Add a checkbox "Attach also main document"
$formmail->withbody = 1;
$formmail->withdeliveryreceipt = 1;
$formmail->withcancel = 1;
// Make substitution in email content
$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $object);
$substitutionarray['__EMAIL__'] = $sendto;
$substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.urlencode($object->thirdparty->tag).'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '';
$substitutionarray['__PERSONALIZED__'] = ''; // deprecated
$substitutionarray['__CONTACTCIVNAME__'] = '';
$parameters = array(
'mode' => 'formemail'
);
complete_substitutions_array($substitutionarray, $langs, $object, $parameters);
// Tableau des substitutions
$formmail->substit = $substitutionarray;
// Tableau des parametres complementaires du post
$formmail->param['action'] = $action;
$formmail->param['models'] = $modelmail;
$formmail->param['models_id'] = empty(GETPOST('modelmailselected', 'int'))?$conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES:GETPOST('modelmailselected', 'int');
$formmail->param['id'] = join(',', $arrayofselected);
// $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedid) > $conf->global->MAILING_LIMIT_SENDBYWEB) {
$langs->load("errors");
print img_warning().' '.$langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB);
print ' - <a href="javascript: window.history.go(-1)">'.$langs->trans("GoBack").'</a>';
$arrayofmassactions = array();
} else {
print $formmail->get_form();
}
print dol_get_fiche_end();
}
// Allow Pre-Mass-Action hook (eg for confirmation dialog)
$parameters = array(
'toselect' => $toselect,
'uploaddir' => isset($uploaddir) ? $uploaddir : null
);

View File

@ -72,11 +72,14 @@ ALTER TABLE llx_salary_extrafields ADD INDEX idx_salary_extrafields (fk_object);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__,<br /><br />__(OrganizationEventConfRequestWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__,<br /><br />__(OrganizationEventConfRequestWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__,<br /><br />__(OrganizationEventBoothRequestWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__,<br /><br />__(OrganizationEventBoothRequestWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
-- TODO Add message for registration only to event __ONLINE_PAYMENT_TEXT_AND_URL__ -- TODO Add message for registration only to event __ONLINE_PAYMENT_TEXT_AND_URL__
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsBooth)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,<br /><br />__(OrganizationEventPaymentOfBoothWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailBoothPayment)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,<br /><br />__(OrganizationEventPaymentOfBoothWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,<br /><br />__(OrganizationEventPaymentOfRegistrationWasReceived)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailRegistrationPayment)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,<br /><br />__(OrganizationEventPaymentOfRegistrationWasReceived)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__,<br /><br />__(OrganizationEventBulkMailToAttendees)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__,<br /><br />__(OrganizationEventBulkMailToAttendees)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__,<br /><br />__(OrganizationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__,<br /><br />__(OrganizationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
UPDATE llx_c_email_templates SET label = '(EventOrganizationEmailBoothPayment)' WHERE label = '(EventOrganizationEmailSubsBooth)';
UPDATE llx_c_email_templates SET label = '(EventOrganizationEmailRegistrationPayment)' WHERE label = '(EventOrganizationEmailSubsEvent)';
--Fix bad sign on multicompany column for customer invoice lines --Fix bad sign on multicompany column for customer invoice lines
UPDATE llx_facturedet SET multicurrency_subprice = -multicurrency_subprice WHERE ((multicurrency_subprice < 0 and subprice > 0) OR (multicurrency_subprice > 0 and subprice < 0)); UPDATE llx_facturedet SET multicurrency_subprice = -multicurrency_subprice WHERE ((multicurrency_subprice < 0 and subprice > 0) OR (multicurrency_subprice > 0 and subprice < 0));

View File

@ -42,12 +42,12 @@ EVENTORGANIZATION_CATEG_THIRDPARTY_CONF = Category to add to third-parties autom
EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH = Category to add to third-parties automatically created when they suggests a booth EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH = Category to add to third-parties automatically created when they suggests a booth
EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF = Template of email to send after receiving a suggestion of a conference. EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF = Template of email to send after receiving a suggestion of a conference.
EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH = Template of email to send after receiving a suggestion of a booth. EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH = Template of email to send after receiving a suggestion of a booth.
EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH = Template of email to send after a registration to a booth has been paid. EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH = Template of email to send after a registration to a booth has been paid.
EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT = Template of email to send after a registration to an event has been paid. EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT = Template of email to send after a registration to an event has been paid.
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Template of email of massaction to attendes EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Template of email to use when sending emails from the massaction "Send emails" to speakers
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Template of email of massaction to speakers EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Template of email to use when sending emails from the massaction "Send emails" on attendee list
EVENTORGANIZATION_FILTERATTENDEES_CAT = Filter thirdpartie's select list in attendees creation card/form with category EVENTORGANIZATION_FILTERATTENDEES_CAT = In the form to create/add an attendee, restricts the list of thirdparties to thirdparties in the category
EVENTORGANIZATION_FILTERATTENDEES_TYPE = Filter thirdpartie's select list in attendees creation card/form with customer type EVENTORGANIZATION_FILTERATTENDEES_TYPE = In the form to create/add an attendee, restricts the list of thirdparties to thirdparties with the nature
# #
# Object # Object
@ -71,6 +71,7 @@ EventOrganizationEmailBoothPayment = Payment of your booth
EventOrganizationEmailRegistrationPayment = Registration for an event EventOrganizationEmailRegistrationPayment = Registration for an event
EventOrganizationMassEmailAttendees = Communication to attendees EventOrganizationMassEmailAttendees = Communication to attendees
EventOrganizationMassEmailSpeakers = Communication to speakers EventOrganizationMassEmailSpeakers = Communication to speakers
ToSpeakers=To speakers
# #
# Event # Event
@ -83,14 +84,14 @@ PriceOfRegistration=Price of registration
PriceOfRegistrationHelp=Price to pay to register or participate in the event PriceOfRegistrationHelp=Price to pay to register or participate in the event
PriceOfBooth=Subscription price to stand a booth PriceOfBooth=Subscription price to stand a booth
PriceOfBoothHelp=Subscription price to stand a booth PriceOfBoothHelp=Subscription price to stand a booth
EventOrganizationICSLink=Link ICS for events EventOrganizationICSLink=Link ICS for conferences
ConferenceOrBoothInformation=Conference Or Booth informations ConferenceOrBoothInformation=Conference Or Booth informations
Attendees=Attendees Attendees=Attendees
ListOfAttendeesOfEvent=List of attendees of the event project ListOfAttendeesOfEvent=List of attendees of the event project
DownloadICSLink = Download ICS link DownloadICSLink = Download ICS link
EVENTORGANIZATION_SECUREKEY = Secure Key of the public registration link to a conference EVENTORGANIZATION_SECUREKEY = Seed to secure the key for the public registration page to suggest a conference
SERVICE_BOOTH_LOCATION = Service used for the invoice row about a booth location SERVICE_BOOTH_LOCATION = Service used for the invoice row about a booth location
SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION = Service used for the invoice row about an attendee subscription to a conference SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION = Service used for the invoice row about an attendee subscription to an event
NbVotes=Number of votes NbVotes=Number of votes
# #
# Status # Status

View File

@ -71,6 +71,7 @@ if (!$user->admin) {
// Parameters // Parameters
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
$value = GETPOST('value', 'alpha'); $value = GETPOST('value', 'alpha');
$label = GETPOST('label', 'alpha'); $label = GETPOST('label', 'alpha');

View File

@ -175,7 +175,10 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
if ($nbofiles) { if ($nbofiles) {
$texte .= '<div id="div_'.get_class($this).'" class="hidden">'; $texte .= '<div id="div_'.get_class($this).'" class="hidden">';
foreach ($listoffiles as $file) { foreach ($listoffiles as $file) {
$texte .= '- '.$file['name'].' <a href="'.DOL_URL_ROOT.'/document.php?modulepart=doctemplates&file=mymodule_myobject/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a><br>'; $texte .= '- '.$file['name'];
$texte .= ' <a href="'.DOL_URL_ROOT.'/document.php?modulepart=doctemplates&file=mymodule_myobject/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a>';
$texte .= ' &nbsp; <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?modulepart=doctemplates&keyforuploaddir=COMPANY_ADDON_PDF_ODT_PATH&action=deletefile&token='.newToken().'&file='.urlencode(basename($file['name'])).'">'.img_picto('', 'delete').'</a>';
$texte .= '<br>';
} }
$texte .= '</div>'; $texte .= '</div>';
} }

View File

@ -46,6 +46,8 @@ if (!$user->admin || (empty($conf->product->enabled) && empty($conf->service->en
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$value = GETPOST('value', 'alpha'); $value = GETPOST('value', 'alpha');
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
$label = GETPOST('label', 'alpha'); $label = GETPOST('label', 'alpha');
$scandir = GETPOST('scan_dir', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha');
$type = 'product'; $type = 'product';

View File

@ -850,8 +850,8 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
$moreforfilter = ''; $moreforfilter = '';
if (count($tasksarray) > 0) { if (count($tasksarray) > 0) {
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans("TasksAssignedTo").': '; $moreforfilter .= img_picto('', 'user', 'class="pictofixedwidth"');
$moreforfilter .= $form->select_dolusers($tmpuser->id > 0 ? $tmpuser->id : '', 'search_user_id', 1); $moreforfilter .= $form->select_dolusers($tmpuser->id > 0 ? $tmpuser->id : '', 'search_user_id', $langs->trans("TasksAssignedTo"), null, 0, '', '');
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
if ($moreforfilter) { if ($moreforfilter) {

View File

@ -74,13 +74,6 @@ $search_task_label = GETPOST('search_task_label', 'alpha');
$search_user = GETPOST('search_user', 'int'); $search_user = GETPOST('search_user', 'int');
$search_valuebilled = GETPOST('search_valuebilled', 'int'); $search_valuebilled = GETPOST('search_valuebilled', 'int');
// Security check
$socid = 0;
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (!$user->rights->projet->lire) {
accessforbidden();
}
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma');
@ -98,6 +91,8 @@ if (!$sortorder) {
$sortorder = 'DESC,DESC,DESC'; $sortorder = 'DESC,DESC,DESC';
} }
$childids = $user->getAllChildIds(1);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
//$object = new TaskTime($db); //$object = new TaskTime($db);
$hookmanager->initHooks(array('projecttasktime', 'globalcard')); $hookmanager->initHooks(array('projecttasktime', 'globalcard'));
@ -113,11 +108,19 @@ if ($id > 0 || $ref) {
$object->fetch($id, $ref); $object->fetch($id, $ref);
} }
// Security check
$socid = 0;
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (!$user->rights->projet->lire) {
accessforbidden();
}
if ($object->fk_project > 0) { if ($object->fk_project > 0) {
restrictedArea($user, 'projet', $object->fk_project, 'projet&project'); restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
} else { } else {
restrictedArea($user, 'projet', null, 'projet&project'); restrictedArea($user, 'projet', null, 'projet&project');
// We check user has permission to see all taks of all users // We check user has permission to see all tasks of all users
if (empty($projectid) && !$user->hasRight('projet', 'all', 'lire')) { if (empty($projectid) && !$user->hasRight('projet', 'all', 'lire')) {
$search_user = $user->id; $search_user = $user->id;
} }
@ -246,10 +249,14 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
$id = GETPOST('taskid', 'int'); $id = GETPOST('taskid', 'int');
$object->fetchTimeSpent(GETPOST('lineid', 'int')); $object->fetchTimeSpent(GETPOST('lineid', 'int'));
// TODO Check that ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids))
$result = $object->delTimeSpent($user); $result = 0;
if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) {
$result = $object->delTimeSpent($user);
}
$object->fetch($id, $ref); $object->fetch($id, $ref);
$object->timespent_note = GETPOST("timespent_note_line", 'alpha'); $object->timespent_note = GETPOST("timespent_note_line", 'alpha');
$object->timespent_old_duration = GETPOST("old_duration"); $object->timespent_old_duration = GETPOST("old_duration");
$object->timespent_duration = GETPOSTINT("new_durationhour") * 60 * 60; // We store duration in seconds $object->timespent_duration = GETPOSTINT("new_durationhour") * 60 * 60; // We store duration in seconds
@ -261,7 +268,12 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
$object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear")); $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear"));
} }
$object->timespent_fk_user = GETPOST("userid_line", 'int'); $object->timespent_fk_user = GETPOST("userid_line", 'int');
$result = $object->addTimeSpent($user);
$result = 0;
if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) {
$result = $object->addTimeSpent($user);
}
if ($result >= 0) { if ($result >= 0) {
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
} else { } else {
@ -270,7 +282,6 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
} }
} else { } else {
$object->fetch($id, $ref); $object->fetch($id, $ref);
// TODO Check that ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids))
$object->timespent_id = GETPOST("lineid", 'int'); $object->timespent_id = GETPOST("lineid", 'int');
$object->timespent_note = GETPOST("timespent_note_line"); $object->timespent_note = GETPOST("timespent_note_line");
@ -285,12 +296,16 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
} }
$object->timespent_fk_user = GETPOST("userid_line", 'int'); $object->timespent_fk_user = GETPOST("userid_line", 'int');
$result = $object->updateTimeSpent($user); $result = 0;
if ($result >= 0) { if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) {
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $result = $object->updateTimeSpent($user);
} else {
setEventMessages($langs->trans($object->error), null, 'errors'); if ($result >= 0) {
$error++; setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans($object->error), null, 'errors');
$error++;
}
} }
} }
} else { } else {
@ -298,18 +313,20 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
} }
} }
if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->lire) { if ($action == 'confirm_deleteline' && $confirm == "yes" && $user->rights->projet->lire) {
$object->fetchTimeSpent(GETPOST('lineid', 'int')); $object->fetchTimeSpent(GETPOST('lineid', 'int')); // load properties like $object->timespent_id
// TODO Check that ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids))
$result = $object->delTimeSpent($user);
if ($result < 0) { if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) {
$langs->load("errors"); $result = $object->delTimeSpent($user); // delete line with $object->timespent_id
setEventMessages($langs->trans($object->error), null, 'errors');
$error++; if ($result < 0) {
$action = ''; $langs->load("errors");
} else { setEventMessages($langs->trans($object->error), null, 'errors');
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); $error++;
$action = '';
} else {
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
} }
} }
@ -888,7 +905,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
} }
} }
$linktocreatetime = dolGetButtonTitle($langs->trans('AddTimeSpent'), $linktocreatetimeHelpText, 'fa fa-plus-circle', $linktocreatetimeUrl, '', $linktocreatetimeBtnStatus); $paramsbutton = array('morecss'=>'reposition');
$linktocreatetime = dolGetButtonTitle($langs->trans('AddTimeSpent'), $linktocreatetimeHelpText, 'fa fa-plus-circle', $linktocreatetimeUrl, '', $linktocreatetimeBtnStatus, $paramsbutton);
} }
$massactionbutton = ''; $massactionbutton = '';
@ -915,7 +933,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
if ($action == 'deleteline') { if ($action == 'deleteline') {
print $form->formconfirm($_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST("lineid", 'int').($withproject ? '&withproject=1' : ''), $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_delete", '', '', 1); print $form->formconfirm($_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST("lineid", 'int').($withproject ? '&withproject=1' : ''), $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
} }
$param = ($withproject ? '&withproject=1' : ''); $param = ($withproject ? '&withproject=1' : '');
@ -1014,7 +1032,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
if ($projectstatic->id > 0 || $allprojectforuser > 0) { if ($projectstatic->id > 0 || $allprojectforuser > 0) {
if ($action == 'deleteline' && !empty($projectidforalltimes)) { if ($action == 'deleteline' && !empty($projectidforalltimes)) {
print $form->formconfirm($_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST('lineid', 'int').($withproject ? '&withproject=1' : ''), $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_delete", '', '', 1); print $form->formconfirm($_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST('lineid', 'int').($withproject ? '&withproject=1' : ''), $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1);
} }
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
@ -1579,8 +1597,6 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
$i = 0; $i = 0;
$childids = $user->getAllChildIds();
$total = 0; $total = 0;
$totalvalue = 0; $totalvalue = 0;
$totalarray = array(); $totalarray = array();
@ -1796,7 +1812,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print '<br>'; print '<br>';
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
} elseif ($user->rights->projet->lire || $user->rights->projet->all->creer) { // Read project and enter time consumed on assigned tasks } elseif ($user->rights->projet->lire || $user->rights->projet->all->creer) { // Read project and enter time consumed on assigned tasks
if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->rights->projet->all->creer) { if (in_array($task_time->fk_user, $childids) || $user->rights->projet->all->creer) {
if ($conf->MAIN_FEATURES_LEVEL >= 2) { if ($conf->MAIN_FEATURES_LEVEL >= 2) {
print '&nbsp;'; print '&nbsp;';
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$task_time->fk_task.'&action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$task_time->fk_task.'&action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';

View File

@ -68,6 +68,7 @@ if (!$user->admin) {
// Parameters // Parameters
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
$value = GETPOST('value', 'alpha'); $value = GETPOST('value', 'alpha');
$label = GETPOST('label', 'alpha'); $label = GETPOST('label', 'alpha');

View File

@ -68,6 +68,7 @@ if (!$user->admin) {
// Parameters // Parameters
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
$value = GETPOST('value', 'alpha'); $value = GETPOST('value', 'alpha');
$label = GETPOST('label', 'alpha'); $label = GETPOST('label', 'alpha');

View File

@ -174,7 +174,10 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi
if ($nbofiles) { if ($nbofiles) {
$texte .= '<div id="div_'.get_class($this).'" class="hidden">'; $texte .= '<div id="div_'.get_class($this).'" class="hidden">';
foreach ($listoffiles as $file) { foreach ($listoffiles as $file) {
$texte .= $file['name'].'<br>'; $texte .= '- '.$file['name'];
//$texte .= ' <a href="'.DOL_URL_ROOT.'/document.php?modulepart=doctemplates&file=recruitementjobposition/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a>';
//$texte .= ' &nbsp; <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?modulepart=doctemplates&keyforuploaddir=RECRUITMENT_RECRUITMENTJOBPOSITION_ADDON_PDF_ODT_PATH&action=deletefile&token='.newToken().'&file='.urlencode(basename($file['name'])).'">'.img_picto('', 'delete').'</a>';
$texte .= '<br>';
} }
$texte .= '</div>'; $texte .= '</div>';
} }

View File

@ -34,7 +34,7 @@ $langs->loadLangs(array("admin", "companies", "other"));
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$value = GETPOST('value', 'alpha'); $value = GETPOST('value', 'alpha');
$modulepart = GETPOST('modulepart', 'aZ09'); $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
if (!$user->admin) { if (!$user->admin) {
accessforbidden(); accessforbidden();

View File

@ -101,10 +101,11 @@ if (!defined('ISLOADEDBYSTEELSHEET')) {
font-size: 25px; font-size: 25px;
line-height: 92px; line-height: 92px;
} }
.opened-dash-board-wrap .info-box-sm .info-box-icon { .opened-dash-board-wrap .info-box .info-box-icon {
border-radius: 0 0 0 20px; font-size: 2em;
} }
.opened-dash-board-wrap .info-box-sm .info-box-icon { .opened-dash-board-wrap .info-box-sm .info-box-icon {
border-radius: 0 0 0 20px;
line-height: 80px; line-height: 80px;
} }
.info-box-module .info-box-icon { .info-box-module .info-box-icon {

View File

@ -198,6 +198,9 @@ a.info-box-text-a i.fa.fa-exclamation-triangle {
font-size: 25px; font-size: 25px;
line-height: 92px; line-height: 92px;
} }
.opened-dash-board-wrap .info-box .info-box-icon {
font-size: 2em;
}
.opened-dash-board-wrap .info-box-sm .info-box-icon { .opened-dash-board-wrap .info-box-sm .info-box-icon {
line-height: 80px; line-height: 80px;
} }

View File

@ -505,6 +505,7 @@ if (empty($reshook)) {
setEventMessages($langs->trans("ErrorLoginAlreadyExists", $object->login), null, 'errors'); setEventMessages($langs->trans("ErrorLoginAlreadyExists", $object->login), null, 'errors');
} else { } else {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = 'edit';
} }
} }
} }

View File

@ -1907,8 +1907,8 @@ class User extends CommonObject
if ($this->pass != $this->pass_indatabase && $this->pass != $this->pass_indatabase_crypted) { if ($this->pass != $this->pass_indatabase && $this->pass != $this->pass_indatabase_crypted) {
// Si mot de passe saisi et different de celui en base // Si mot de passe saisi et different de celui en base
$result = $this->setPassword($user, $this->pass, 0, $notrigger, $nosyncmemberpass); $result = $this->setPassword($user, $this->pass, 0, $notrigger, $nosyncmemberpass);
if (!$nbrowsaffected) { if ($result < 0) {
$nbrowsaffected++; return -5;
} }
} }
} }
@ -2148,6 +2148,7 @@ class User extends CommonObject
} }
} }
// Now, we encrypt the new password // Now, we encrypt the new password
$password_crypted = dol_hash($password); $password_crypted = dol_hash($password);
} }

View File

@ -292,6 +292,72 @@ if ($user->admin) {
} }
print '</tr>'."\n"; print '</tr>'."\n";
// Fix bad value for module_position in table
// ------------------------------------------
$sql = "SELECT r.id, r.libelle as label, r.module, r.perms, r.subperms, r.module_position, r.bydefault";
$sql .= " FROM ".MAIN_DB_PREFIX."rights_def as r";
$sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous"
$sql .= " AND r.entity = ".((int) $entity);
$sql .= " ORDER BY r.family_position, r.module_position, r.module, r.id";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$i = 0;
$oldmod = '';
while ($i < $num) {
$obj = $db->fetch_object($result);
// If line is for a module that does not exist anymore (absent of includes/module), we ignore it
if (empty($modules[$obj->module])) {
$i++;
continue;
}
// Special cases
if (!empty($conf->reception->enabled)) {
// The 2 permissions in fournisseur modules are replaced by permissions into reception module
if ($obj->module == 'fournisseur' && $obj->perms == 'commande' && $obj->subperms == 'receptionner') {
$i++;
continue;
}
if ($obj->module == 'fournisseur' && $obj->perms == 'commande_advance' && $obj->subperms == 'check') {
$i++;
continue;
}
}
$objMod = $modules[$obj->module];
// Save field module_position in database if value is wrong
if (empty($obj->module_position) || (is_object($objMod) && $objMod->isCoreOrExternalModule() == 'external' && $obj->module_position < 100000)) {
if (is_object($modules[$obj->module]) && ($modules[$obj->module]->module_position > 0)) {
// TODO Define familyposition
//$familyposition = $modules[$obj->module]->family_position;
$familyposition = 0;
$newmoduleposition = $modules[$obj->module]->module_position;
// Correct $newmoduleposition position for external modules
$objMod = $modules[$obj->module];
if (is_object($objMod) && $objMod->isCoreOrExternalModule() == 'external' && $newmoduleposition < 100000) {
$newmoduleposition += 100000;
}
$sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".((int) $newmoduleposition).",";
$sqlupdate .= " family_position = ".((int) $familyposition);
$sqlupdate .= " WHERE module_position = ".((int) $obj->module_position)." AND module = '".$db->escape($obj->module)."'";
$db->query($sqlupdate);
}
}
}
}
//print "xx".$conf->global->MAIN_USE_ADVANCED_PERMS; //print "xx".$conf->global->MAIN_USE_ADVANCED_PERMS;
$sql = "SELECT r.id, r.libelle as label, r.module, r.perms, r.subperms, r.module_position, r.bydefault"; $sql = "SELECT r.id, r.libelle as label, r.module, r.perms, r.subperms, r.module_position, r.bydefault";
$sql .= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql .= " FROM ".MAIN_DB_PREFIX."rights_def as r";
@ -333,6 +399,7 @@ if ($result) {
$objMod = $modules[$obj->module]; $objMod = $modules[$obj->module];
// Save field module_position in database if value is wrong // Save field module_position in database if value is wrong
/*
if (empty($obj->module_position) || (is_object($objMod) && $objMod->isCoreOrExternalModule() == 'external' && $obj->module_position < 100000)) { if (empty($obj->module_position) || (is_object($objMod) && $objMod->isCoreOrExternalModule() == 'external' && $obj->module_position < 100000)) {
if (is_object($modules[$obj->module]) && ($modules[$obj->module]->module_position > 0)) { if (is_object($modules[$obj->module]) && ($modules[$obj->module]->module_position > 0)) {
// TODO Define familyposition // TODO Define familyposition
@ -354,6 +421,7 @@ if ($result) {
$db->query($sqlupdate); $db->query($sqlupdate);
} }
} }
*/
// Break found, it's a new module to catch // Break found, it's a new module to catch
if (isset($obj->module) && ($oldmod <> $obj->module)) { if (isset($obj->module) && ($oldmod <> $obj->module)) {