Fix AdvtargetEmailing
This commit is contained in:
parent
fc76383718
commit
c85bf18f0e
@ -22,6 +22,8 @@
|
|||||||
* \brief Page to define emailing targets
|
* \brief Page to define emailing targets
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1');
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/comm/mailing/class/mailing.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/comm/mailing/class/mailing.class.php';
|
||||||
@ -404,14 +406,8 @@ if ($_POST["button_removefilter"]) {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$extrajs = array (
|
|
||||||
'/includes/jquery/plugins/multiselect/js/ui.multiselect.js'
|
|
||||||
);
|
|
||||||
$extracss = array (
|
|
||||||
'/includes/jquery/plugins/multiselect/css/ui.multiselect.css',
|
|
||||||
);
|
|
||||||
|
|
||||||
llxHeader('', $langs->trans("MailAdvTargetRecipients"), '', '', '', '', $extrajs, $extracss);
|
llxHeader('', $langs->trans("MailAdvTargetRecipients"));
|
||||||
|
|
||||||
print '<script type="text/javascript" language="javascript">
|
print '<script type="text/javascript" language="javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|||||||
@ -89,7 +89,7 @@ class FormAdvTargetEmailing extends Form
|
|||||||
|
|
||||||
$langs->load("dict");
|
$langs->load("dict");
|
||||||
$maxlength = 0;
|
$maxlength = 0;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
$countryArray = array();
|
$countryArray = array();
|
||||||
$label = array ();
|
$label = array ();
|
||||||
@ -252,7 +252,7 @@ class FormAdvTargetEmailing extends Form
|
|||||||
// $sql.= ' WHERE entity = '.$conf->entity;
|
// $sql.= ' WHERE entity = '.$conf->entity;
|
||||||
|
|
||||||
$options_array = array();
|
$options_array = array();
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::".__METHOD__,LOG_DEBUG);
|
dol_syslog(get_class($this) . "::".__METHOD__,LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
@ -335,49 +335,8 @@ class FormAdvTargetEmailing extends Form
|
|||||||
function advMultiselectarray($htmlname, $options_array = array(), $selected_array = array(), $showempty = 0) {
|
function advMultiselectarray($htmlname, $options_array = array(), $selected_array = array(), $showempty = 0) {
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$return = '';
|
$form=new Form($this->db);
|
||||||
$return .= '<script type="text/javascript" language="javascript">
|
$return = $form->multiselectarray($htmlname, $options_array, $selected_array,0,0,'',0,295);
|
||||||
$(document).ready(function() {
|
|
||||||
$.extend($.ui.multiselect.locale, {
|
|
||||||
addAll:\'' . $langs->transnoentities ( "AddAll" ) . '\',
|
|
||||||
removeAll:\'' . $langs->transnoentities ( "RemoveAll" ) . '\',
|
|
||||||
itemsCount:\'' . $langs->transnoentities ( "ItemsCount" ) . '\'
|
|
||||||
});
|
|
||||||
|
|
||||||
$(function(){
|
|
||||||
$("#' . $htmlname . '").addClass("' . $htmlname . '").attr("multiple","multiple").attr("name","' . $htmlname . '[]");
|
|
||||||
$(".multiselect").multiselect({sortable: false, searchable: false});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>';
|
|
||||||
$return .= '<select id="' . $htmlname . '" class="multiselect" multiple="multiple" name="' . $htmlname . '[]" style="display: none;">';
|
|
||||||
//$return .= '<select id="' . $htmlname . '" class="multiselect" multiple="multiple" name="' . $htmlname . '[]">';
|
|
||||||
|
|
||||||
if ($showempty)
|
|
||||||
$return .= '<option value=""> </option>';
|
|
||||||
|
|
||||||
// Find if keys is in selected array value
|
|
||||||
if (is_array($selected_array) && count($selected_array)>0) {
|
|
||||||
$intersect_array = array_intersect_key($options_array, array_flip($selected_array));
|
|
||||||
} else {
|
|
||||||
$intersect_array=array();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count($options_array) > 0) {
|
|
||||||
foreach ($options_array as $keyoption => $valoption) {
|
|
||||||
// If key is in intersect table then it have to e selected
|
|
||||||
$selected = '';
|
|
||||||
if (count ( $intersect_array ) > 0) {
|
|
||||||
if (array_key_exists ( $keyoption, $intersect_array )) {
|
|
||||||
$selected = ' selected="selected"';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$return .= '<option' . $selected . ' value="' . $keyoption . '">' . $valoption . '</option>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$return .= '</select>';
|
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,7 +407,7 @@ class FormAdvTargetEmailing extends Form
|
|||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->advMultiselectarray ( $htmlname, $options_array, $selected_array );
|
return $this->advMultiselectarray( $htmlname, $options_array, $selected_array );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -534,3 +534,5 @@ ALTER TABLE llx_blockedlog_authority ADD INDEX signature (signature);
|
|||||||
|
|
||||||
UPDATE llx_bank SET label= '(SupplierInvoicePayment)' WHERE label= 'Règlement fournisseur';
|
UPDATE llx_bank SET label= '(SupplierInvoicePayment)' WHERE label= 'Règlement fournisseur';
|
||||||
UPDATE llx_bank SET label= '(CustomerInvoicePayment)' WHERE label= 'Règlement client';
|
UPDATE llx_bank SET label= '(CustomerInvoicePayment)' WHERE label= 'Règlement client';
|
||||||
|
|
||||||
|
ALTER TABLE llx_mailing_cibles MODIFY COLUMN source_url varchar(1000);
|
||||||
@ -30,7 +30,7 @@ create table llx_mailing_cibles
|
|||||||
other varchar(255) NULL,
|
other varchar(255) NULL,
|
||||||
tag varchar(128) NULL,
|
tag varchar(128) NULL,
|
||||||
statut smallint NOT NULL DEFAULT 0, -- -1 = error, 0 = not sent, ...
|
statut smallint NOT NULL DEFAULT 0, -- -1 = error, 0 = not sent, ...
|
||||||
source_url varchar(160),
|
source_url varchar(1000),
|
||||||
source_id integer,
|
source_id integer,
|
||||||
source_type varchar(16),
|
source_type varchar(16),
|
||||||
date_envoi datetime,
|
date_envoi datetime,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user