Skip to content
Snippets Groups Projects
Commit cf6f4405 authored by Jean-François Ferry's avatar Jean-François Ferry
Browse files

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

Conflicts:
	htdocs/comm/propal.php
parents a8874ebc bbe68e34
No related branches found
No related tags found
No related merge requests found
Showing
with 269 additions and 160 deletions
...@@ -27,6 +27,7 @@ For users: ...@@ -27,6 +27,7 @@ For users:
- New: [ task #748 ] Add a link "Dolibarr" into left menu - New: [ task #748 ] Add a link "Dolibarr" into left menu
- New: Script email_unpaid_invoices_to_representative accepts now a parameter test - New: Script email_unpaid_invoices_to_representative accepts now a parameter test
and a delay. and a delay.
- New: Can define a different clicktodial setup per user.
- First change to prepare feature click to print for PDF. - First change to prepare feature click to print for PDF.
For translators: For translators:
......
#!/bin/sh
#
# Checks if files contains UTF-8 BOM
# in dolibarr source tree excluding
# git repository, custom modules and incuded libraries
#
# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
grep -rlI \
--exclude-dir='.git' --exclude-dir='includes' --exclude-dir='custom' \
$'\xEF\xBB\xBF' .
...@@ -4,12 +4,27 @@ ...@@ -4,12 +4,27 @@
# #
# Laurent Destailleur - eldy@users.sourceforge.net # Laurent Destailleur - eldy@users.sourceforge.net
#------------------------------------------------------ #------------------------------------------------------
# Usage: finddosfiles.sh # Usage: fixdosfiles.sh [list|fix]
#------------------------------------------------------ #------------------------------------------------------
# Syntax
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
then
echo "Usage: fixdosfiles.sh [list|fix]"
fi
# To detec # To detec
find . -type f -iname "*.php" -exec file "{}" + | grep CRLF if [ "x$1" = "xlist" ]
then
find . -iname "*.php" -o -iname "*.sh" -o -iname "*.pl" -o -iname "*.lang" -o -iname "*.txt" -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF
fi
# To convert # To convert
#find . -type f -iname "*.php" -exec dos2unix "{}" +; if [ "x$1" = "xfix" ]
then
for fic in `find . -iname "*.php" -o -iname "*.sh" -o -iname "*.pl" -o -iname "*.lang" -o -iname "*.txt" -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF | awk -F':' '{ print $1 }' `
do
echo "Fix file $fic"
dos2unix $fic
done;
fi
#!/bin/sh
#
# Checks of fix files contains UTF-8 BOM in dolibarr source tree,
# excluding git repository, custom modules and included libraries.
#
# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
# Laurent Destailleur eldy@users.sourceforge.net
#------------------------------------------------------
# Usage: fixutf8bomfiles.sh [list|fix]
#------------------------------------------------------
# Syntax
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
then
echo "Usage: fixutf8bomfiles.sh [list|fix]"
fi
# To detec
if [ "x$1" = "xlist" ]
then
#find . -iname '*.php' -print0 -o -iname '*.sh' -print0 -o -iname '*.pl' -print0 -o -iname '*.lang' -print0 -o -iname '*.txt' -print0 | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'
grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='includes' --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'
fi
# To convert
if [ "x$1" = "xfix" ]
then
for fic in `grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='includes' --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'`
do
echo "Fixing $fic"
sed -i '1s/^\xEF\xBB\xBF//' $fic
done;
fi
#!/bin/sh
#
# Removes UTF-8 BOM from a file list on STDIN
# Use by piping the output of a findutf8bom script
#
# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
#
# Example:
# cd dirwithfiles
# ls | /path/dev/removeutf8bom.sh
while read f; do
echo "Fixing $f"
sed -i '1s/^\xEF\xBB\xBF//' $f
done
...@@ -41,6 +41,10 @@ class Adherent extends CommonObject ...@@ -41,6 +41,10 @@ class Adherent extends CommonObject
public $table_element='adherent'; public $table_element='adherent';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $error;
var $errors;
var $mesgs;
var $id; var $id;
var $ref; var $ref;
var $civilite_id; var $civilite_id;
...@@ -1370,10 +1374,10 @@ class Adherent extends CommonObject ...@@ -1370,10 +1374,10 @@ class Adherent extends CommonObject
*/ */
function add_to_abo() function add_to_abo()
{ {
global $conf; global $conf,$langs;
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
$mailmanspip=new MailmanSpip($db); $mailmanspip=new MailmanSpip($this->db);
$err=0; $err=0;
...@@ -1386,6 +1390,16 @@ class Adherent extends CommonObject ...@@ -1386,6 +1390,16 @@ class Adherent extends CommonObject
$this->error=$mailmanspip->error; $this->error=$mailmanspip->error;
$err+=1; $err+=1;
} }
foreach ($mailmanspip->mladded_ko as $tmplist => $tmpemail)
{
$langs->load("errors");
$this->errors[]=$langs->trans("ErrorFailedToAddToMailmanList",$tmpemail,$tmplist);
}
foreach ($mailmanspip->mladded_ok as $tmplist => $tmpemail)
{
$langs->load("mailmanspip");
$this->mesgs[]=$langs->trans("SuccessToAddToMailmanList",$tmpemail,$tmplist);
}
} }
// spip // spip
...@@ -1400,7 +1414,6 @@ class Adherent extends CommonObject ...@@ -1400,7 +1414,6 @@ class Adherent extends CommonObject
} }
if ($err) if ($err)
{ {
// error
return -$err; return -$err;
} }
else else
...@@ -1418,10 +1431,10 @@ class Adherent extends CommonObject ...@@ -1418,10 +1431,10 @@ class Adherent extends CommonObject
*/ */
function del_to_abo() function del_to_abo()
{ {
global $conf; global $conf,$langs;
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
$mailmanspip=new MailmanSpip($db); $mailmanspip=new MailmanSpip($this->db);
$err=0; $err=0;
...@@ -1431,8 +1444,20 @@ class Adherent extends CommonObject ...@@ -1431,8 +1444,20 @@ class Adherent extends CommonObject
$result=$mailmanspip->del_to_mailman($this); $result=$mailmanspip->del_to_mailman($this);
if ($result < 0) if ($result < 0)
{ {
$this->error=$mailmanspip->error;
$err+=1; $err+=1;
} }
foreach ($mailmanspip->mlremoved_ko as $tmplist => $tmpemail)
{
$langs->load("errors");
$this->errors[]=$langs->trans("ErrorFailedToRemoveToMailmanList",$tmpemail,$tmplist);
}
foreach ($mailmanspip->mlremoved_ok as $tmplist => $tmpemail)
{
$langs->load("mailmanspip");
$this->mesgs[]=$langs->trans("SuccessToRemoveToMailmanList",$tmpemail,$tmplist);
}
} }
if ($conf->global->ADHERENT_USE_SPIP && ! empty($conf->mailmanspip->enabled)) if ($conf->global->ADHERENT_USE_SPIP && ! empty($conf->mailmanspip->enabled))
......
...@@ -353,14 +353,23 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) ...@@ -353,14 +353,23 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
{ {
if ($object->oldcopy->del_to_abo() < 0) if ($object->oldcopy->del_to_abo() < 0)
{ {
// error if (! empty($object->oldcopy->error)) setEventMessage($langs->trans("ErrorFailedToRemoveToMailmanList").': '.$object->oldcopy->error, 'errors');
$errmsgs[]= $langs->trans("FailedToCleanMailmanList").': '.$object->error."<br>\n"; setEventMessage($object->oldcopy->errors, 'errors');
}
else
{
setEventMessage($object->oldcopy->mesgs,'mesgs');
} }
} }
if ($object->add_to_abo() < 0) // We add subscription if new email or new type (new type may means more mailing-list to subscribe) // We add subscription if new email or new type (new type may means more mailing-list to subscribe)
if ($object->add_to_abo() < 0)
{ {
// error if (! empty($object->error)) setEventMessage($langs->trans("ErrorFailedToAddToMailmanList").': '.$object->error, 'errors');
$errmsgs[]= $langs->trans("FailedToAddToMailmanList").': '.$object->error."<br>\n"; setEventMessage($object->errors, 'errors');
}
else
{
setEventMessage($object->mesgs, 'mesgs');
} }
} }
......
...@@ -419,7 +419,7 @@ print "</tr>\n"; ...@@ -419,7 +419,7 @@ print "</tr>\n";
print "</table><br>\n"; print "</table><br>\n";
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();
......
...@@ -54,6 +54,8 @@ if ($action == 'setvalue' && $user->admin) ...@@ -54,6 +54,8 @@ if ($action == 'setvalue' && $user->admin)
* View * View
*/ */
$user->fetch_clicktodial();
$wikihelp='EN:Module_ClickToDial_En|FR:Module_ClickToDial|ES:Módulo_ClickTodial_Es'; $wikihelp='EN:Module_ClickToDial_En|FR:Module_ClickToDial|ES:Módulo_ClickTodial_Es';
llxHeader('',$langs->trans("ClickToDialSetup"),$wikihelp); llxHeader('',$langs->trans("ClickToDialSetup"),$wikihelp);
...@@ -69,33 +71,67 @@ print '<input type="hidden" name="action" value="setvalue">'; ...@@ -69,33 +71,67 @@ print '<input type="hidden" name="action" value="setvalue">';
$var=true; $var=true;
print '<table class="nobordernopadding" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="120">'.$langs->trans("Name").'</td>'; print '<td width="120">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Value").'</td>'; print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n"; print "</tr>\n";
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td valign="top">'; print '<tr '.$bc[$var].'><td valign="top">';
print $langs->trans("URL").'</td><td>'; print $langs->trans("DefaultLink").'</td><td>';
print '<input size="92" type="text" name="url" value="'.$conf->global->CLICKTODIAL_URL.'"><br>'; print '<input size="92" type="text" name="url" value="'.$conf->global->CLICKTODIAL_URL.'"><br>';
print '<br>'; print '<br>';
print $langs->trans("ClickToDialUrlDesc").'<br>'; print $langs->trans("ClickToDialUrlDesc").'<br>';
print $langs->trans("Example").':<br>http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__'; print $langs->trans("Example").':<br>http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__';
//if (! empty($user->clicktodial_url))
//{
print '<br>';
print info_admin($langs->trans("ValueOverwrittenByUserSetup"));
//}
print '</td></tr>'; print '</td></tr>';
print '<tr><td colspan="3" align="center"><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>'; print '</table>';
print '</table></form>';
print '<center><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></center>';
print '</form><br><br>';
if (! empty($conf->global->CLICKTODIAL_URL))
{
$user->fetch_clicktodial();
$phonefortest=$mysoc->phone;
if (GETPOST('phonefortest')) $phonefortest=GETPOST('phonefortest');
/*if (! empty($conf->global->CLICKTODIAL_URL)) print '<form action="'.$_SERVER["PHP_SELF"].'">';
print $langs->trans("LinkToTestClickToDial",$user->login).' : ';
print '<input class="flat" type="text" name="phonefortest" value="'.dol_escape_htmltag($phonefortest).'">';
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("RefreshPhoneLink")).'">';
print '</form>';
$setupcomplete=1;
if (preg_match('/__LOGIN__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_login)) $setupcomplete=0;
if (preg_match('/__PASSWORD__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_password)) $setupcomplete=0;
if (preg_match('/__PHONEFROM__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_poste)) $setupcomplete=0;
if ($setupcomplete)
{ {
print $langs->trans("Test"); print $langs->trans("LinkToTest",$user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL');
// Add a phone number to test }
else
{
$langs->load("errors");
print '<div class="warning">'.$langs->trans("WarningClickToDialUserSetupNotComplete").'</div>';
}
} }
*/
dol_htmloutput_mesg($mesg); dol_htmloutput_mesg($mesg);
$db->close();
llxFooter(); llxFooter();
$db->close();
?> ?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment