Skip to content

Commit

Permalink
Debug emailcollector
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 26, 2019
1 parent f991d4b commit d8212d8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
18 changes: 15 additions & 3 deletions htdocs/admin/emailcollector_card.php
Expand Up @@ -442,8 +442,21 @@ function init_myfunc()
// Add filter
print '<tr class="oddeven">';
print '<td>';
$arrayoftypes=array('from'=>'MailFrom', 'to'=>'MailTo', 'cc'=>'Cc', 'bcc'=>'Bcc', 'subject'=>'Subject', 'body'=>'Body', 'seen'=>'AlreadyRead', 'unseen'=>'NotRead', 'withtrackingid'=>'WithDolTrackingID', 'withouttrackingid'=>'WithoutDolTrackingID');
print $form->selectarray('filtertype', $arrayoftypes, '', 1, 0, 0, '', 1);
$arrayoftypes=array(
'from'=>'MailFrom',
'to'=>'MailTo',
'cc'=>'Cc',
'bcc'=>'Bcc',
'subject'=>'Subject',
'body'=>'Body',
'X1'=>'---',
'seen'=>'AlreadyRead',
'unseen'=>'NotRead',
'X2'=>'---',
'withtrackingid'=>'WithDolTrackingID',
'withouttrackingid'=>'WithoutDolTrackingID'
);
print $form->selectarray('filtertype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', '', 0, '', 2);
print '</td><td>';
print '<input type="text" name="rulevalue">';
print '</td>';
Expand All @@ -461,7 +474,6 @@ function init_myfunc()
print '</td>';
print '<td>'.$rulefilter['rulevalue'].'</td>';
print '<td class="right">';
//print $rulefilterobj->getLibStatut(3);
print ' <a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletefilter&filterid='.$rulefilter['id'].'">'.img_delete().'</a>';
print '</td>';
print '</tr>';
Expand Down
8 changes: 4 additions & 4 deletions htdocs/core/class/html.form.class.php
Expand Up @@ -5841,10 +5841,10 @@ public function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $sh
* @param string $morecss Add more class to css styles
* @param int $addjscombo Add js combo
* @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set
* @param int $disablebademail Check if an email is found into value and if not disable and colorize entry
* @param int $disablebademail 1=Check if a not valid email, 2=Check string '---', and if found into value, disable and colorize entry
* @param int $nohtmlescape No html escaping.
* @return string HTML select string.
* @see multiselectarray, selectArrayAjax, selectArrayFilter
* @see multiselectarray(), selectArrayAjax(), selectArrayFilter()
*/
public static function selectarray($htmlname, $array, $id = '', $show_empty = 0, $key_in_label = 0, $value_as_key = 0, $moreparam = '', $translate = 0, $maxlen = 0, $disabled = 0, $sort = '', $morecss = '', $addjscombo = 0, $moreparamonempty = '', $disablebademail = 0, $nohtmlescape = 0)
{
Expand Down Expand Up @@ -5902,9 +5902,9 @@ public static function selectarray($htmlname, $array, $id = '', $show_empty = 0,
$disabled=''; $style='';
if (! empty($disablebademail))
{
if (! preg_match('/&lt;.+@.+&gt;/', $value))
if (($disablebademail == 1 && ! preg_match('/&lt;.+@.+&gt;/', $value))
|| ($disablebademail == 2 && preg_match('/---/', $value)))
{
//$value=preg_replace('/'.preg_quote($a,'/').'/', $b, $value);
$disabled=' disabled';
$style=' class="warning"';
}
Expand Down

0 comments on commit d8212d8

Please sign in to comment.