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

Conflicts:
	htdocs/comm/propal.php
This commit is contained in:
jfefe 2013-04-01 19:44:55 +02:00
commit cf6f4405cb
147 changed files with 2514 additions and 2077 deletions

View File

@ -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:

View File

@ -1,15 +0,0 @@
#!/bin/sh
#------------------------------------------------------
# Script to find files that are not Unix encoded
#
# Laurent Destailleur - eldy@users.sourceforge.net
#------------------------------------------------------
# Usage: finddosfiles.sh
#------------------------------------------------------
# To detec
find . -type f -iname "*.php" -exec file "{}" + | grep CRLF
# To convert
#find . -type f -iname "*.php" -exec dos2unix "{}" +;

View File

@ -1,10 +0,0 @@
#!/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' .

30
dev/fixdosfiles.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
#------------------------------------------------------
# Script to find files that are not Unix encoded
#
# Laurent Destailleur - eldy@users.sourceforge.net
#------------------------------------------------------
# Usage: fixdosfiles.sh [list|fix]
#------------------------------------------------------
# Syntax
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
then
echo "Usage: fixdosfiles.sh [list|fix]"
fi
# To detec
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
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

33
dev/fixutf8bomfiles.sh Executable file
View File

@ -0,0 +1,33 @@
#!/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

View File

@ -1,15 +0,0 @@
#!/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

View File

@ -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
*/ */
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
$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,11 +1414,10 @@ class Adherent extends CommonObject
} }
if ($err) if ($err)
{ {
// error
return -$err; return -$err;
} }
else else
{ {
return 1; return 1;
} }
} }
@ -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
$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))

View File

@ -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)
{
if (! empty($object->error)) setEventMessage($langs->trans("ErrorFailedToAddToMailmanList").': '.$object->error, 'errors');
setEventMessage($object->errors, 'errors');
}
else
{ {
// error setEventMessage($object->mesgs, 'mesgs');
$errmsgs[]= $langs->trans("FailedToAddToMailmanList").': '.$object->error."<br>\n";
} }
} }

View File

@ -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();

View File

@ -38,7 +38,7 @@ $action = GETPOST("action");
*/ */
if ($action == 'setvalue' && $user->admin) if ($action == 'setvalue' && $user->admin)
{ {
$result=dolibarr_set_const($db, "CLICKTODIAL_URL",GETPOST("url"),'chaine',0,'',$conf->entity); $result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("url"), 'chaine', 0, '', $conf->entity);
if ($result >= 0) if ($result >= 0)
{ {
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>"; $mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
@ -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">';
$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>';
/*if (! empty($conf->global->CLICKTODIAL_URL)) print '<center><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></center>';
{
print $langs->trans("Test"); print '</form><br><br>';
// Add a phone number to test
}
*/ if (! empty($conf->global->CLICKTODIAL_URL))
{
$user->fetch_clicktodial();
$phonefortest=$mysoc->phone;
if (GETPOST('phonefortest')) $phonefortest=GETPOST('phonefortest');
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("LinkToTest",$user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL');
}
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();
?> ?>

View File

@ -161,7 +161,7 @@ if ($action == 'edit')
{ {
$form=new Form($db); $form=new Form($db);
if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=sms_manager">DoliStore</a>').'</div>'; if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=smsmanager">DoliStore</a>').'</div>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -217,7 +217,7 @@ else
{ {
$var=true; $var=true;
if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=sms_manager">DoliStore</a>').'</div>'; if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=smsmanager">DoliStore</a>').'</div>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';

View File

@ -121,12 +121,13 @@ if ($catname || $id > 0)
} }
print "</table>"; print "</table>";
} }
else print '&nbsp;';
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
print '<br>'; print '<div class="fichecenter"><br>';
// Charge tableau des categories // Charge tableau des categories
@ -187,6 +188,7 @@ else
print "</table>"; print "</table>";
print '</div>';
llxFooter(); llxFooter();

View File

@ -546,7 +546,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -201,7 +201,7 @@ else
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
if ($langs->file_exists("html/spam.html",0)) { if ($langs->file_exists("html/spam.html",0)) {

View File

@ -2165,7 +2165,7 @@ else
{ {
$ref = dol_sanitizeFileName($object->ref); $ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/')); $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
// Build document if it not exists // Build document if it not exists
@ -2188,7 +2188,7 @@ else
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/')); $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
} }

View File

@ -513,7 +513,7 @@ if (! empty($conf->propal->enabled))
*/ */
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -279,7 +279,7 @@ if ($resql)
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -2374,7 +2374,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
{ {
$ref = dol_sanitizeFileName($object->ref); $ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/')); $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
// Build document if it not exists // Build document if it not exists
@ -2397,7 +2397,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/')); $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
} }

View File

@ -425,7 +425,7 @@ if (! empty($conf->commande->enabled))
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -3495,7 +3495,7 @@ else if ($id > 0 || ! empty($ref))
$ref = dol_sanitizeFileName($object->ref); $ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($object->ref,'/')); $fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
// Build document if it not exists // Build document if it not exists
@ -3518,7 +3518,7 @@ else if ($id > 0 || ! empty($ref))
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($object->ref,'/')); $fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
} }

View File

@ -1033,7 +1033,7 @@ if ($resql)
} }
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -146,7 +146,7 @@ else
//print "</td></tr></table>\n"; //print "</td></tr></table>\n";
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -221,7 +221,7 @@ else
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -94,7 +94,7 @@ if ($resql)
print "</table>\n"; print "</table>\n";
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -604,7 +604,7 @@ else
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -51,7 +51,14 @@ abstract class CommonDocGenerator
'myuser_firstname'=>$user->firstname, 'myuser_firstname'=>$user->firstname,
'myuser_login'=>$user->login, 'myuser_login'=>$user->login,
'myuser_phone'=>$user->office_phone, 'myuser_phone'=>$user->office_phone,
'myuser_fax'=>$user->office_fax, 'myuser_address'=>$user->address,
'myuser_zip'=>$user->zip,
'myuser_town'=>$user->town,
'myuser_country'=>$user->country,
'myuser_country_code'=>$user->country_code,
'myuser_state'=>$user->state,
'myuser_state_code'=>$user->state_code,
'myuser_fax'=>$user->office_fax,
'myuser_mobile'=>$user->user_mobile, 'myuser_mobile'=>$user->user_mobile,
'myuser_email'=>$user->email, 'myuser_email'=>$user->email,
'myuser_web'=>'' // url not exist in $user object 'myuser_web'=>'' // url not exist in $user object
@ -190,6 +197,28 @@ abstract class CommonDocGenerator
} }
/**
* Define array with couple subtitution key => subtitution value
*
* @param Translate $outputlangs Language object for output
* @return array Array of substitution key->code
*/
function get_substitutionarray_other($outputlangs)
{
global $conf;
$now=dol_now('gmt'); // gmt
$array_other = array(
'current_date'=>dol_print_date($now,'day','tzuser'),
'current_datehour'=>dol_print_date($now,'dayhour','tzuser'),
'current_server_date'=>dol_print_date($now,'day','tzserver'),
'current_server_datehour'=>dol_print_date($now,'dayhour','tzserver'),
);
return $array_other;
}
/** /**
* Define array with couple substitution key => substitution value * Define array with couple substitution key => substitution value
* *

View File

@ -512,6 +512,7 @@ class Menubase
if ($type_user == 0) $sql.= " AND m.usertype IN (0,2)"; if ($type_user == 0) $sql.= " AND m.usertype IN (0,2)";
if ($type_user == 1) $sql.= " AND m.usertype IN (1,2)"; if ($type_user == 1) $sql.= " AND m.usertype IN (1,2)";
$sql.= " ORDER BY m.position, m.rowid"; $sql.= " ORDER BY m.position, m.rowid";
//print $sql;
//$tmp1=dol_microtime_float(); //$tmp1=dol_microtime_float();
//print '>>> 1 0<br>'; //print '>>> 1 0<br>';
@ -533,17 +534,21 @@ class Menubase
$perms = true; $perms = true;
if ($menu['perms']) if ($menu['perms'])
{ {
$perms = verifCond($menu['perms']); $tmpcond=$menu['perms'];
//print "verifCond rowid=".$menu['rowid']." ".$menu['perms'].":".$perms."<br>\n"; if ($leftmenu == 'all') $tmpcond=preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z]+/','1==1',$tmpcond); // Force part of condition to true
$perms = verifCond($tmpcond);
//print "verifCond rowid=".$menu['rowid']." ".$tmpcond.":".$perms."<br>\n";
} }
// Define $enabled // Define $enabled
$enabled = true; $enabled = true;
if ($menu['enabled']) if ($menu['enabled'])
{ {
$enabled = verifCond($menu['enabled']); $tmpcond=$menu['enabled'];
if ($leftmenu == 'all') $tmpcond=preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z]+/','1==1',$tmpcond); // Force part of condition to true
$enabled = verifCond($tmpcond);
if ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_MENU_USE_JQUERY_ACCORDION) && preg_match('/^\$leftmenu/',$menu['enabled'])) $enabled=1; if ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_MENU_USE_JQUERY_ACCORDION) && preg_match('/^\$leftmenu/',$menu['enabled'])) $enabled=1;
//print "verifCond rowid=".$menu['rowid']." ".$menu['enabled'].":".$enabled."<br>\n"; //print "verifCond rowid=".$menu['rowid']." ".$tmpcond.":".$enabled."<br>\n";
} }
// Define $title // Define $title

View File

@ -886,21 +886,23 @@ class DoliDBMysql
$sqlfields[$i] = $field_name." "; $sqlfields[$i] = $field_name." ";
$sqlfields[$i] .= $field_desc['type']; $sqlfields[$i] .= $field_desc['type'];
if( preg_match("/^[^\s]/i",$field_desc['value'])) if( preg_match("/^[^\s]/i",$field_desc['value']))
$sqlfields[$i] .= "(".$field_desc['value'].")"; $sqlfields[$i] .= "(".$field_desc['value'].")";
else if( preg_match("/^[^\s]/i",$field_desc['attribute'])) if( preg_match("/^[^\s]/i",$field_desc['attribute']))
$sqlfields[$i] .= " ".$field_desc['attribute']; $sqlfields[$i] .= " ".$field_desc['attribute'];
else if( preg_match("/^[^\s]/i",$field_desc['default'])) if( preg_match("/^[^\s]/i",$field_desc['default']))
{ {
if(preg_match("/null/i",$field_desc['default'])) if(preg_match("/null/i",$field_desc['default']))
$sqlfields[$i] .= " default ".$field_desc['default']; $sqlfields[$i] .= " default ".$field_desc['default'];
elseif ($field_desc['default'] == 'CURRENT_TIMESTAMP')
$sqlfields[$i] .= " default ".$field_desc['default'];
else else
$sqlfields[$i] .= " default '".$field_desc['default']."'"; $sqlfields[$i] .= " default '".$field_desc['default']."'";
} }
else if( preg_match("/^[^\s]/i",$field_desc['null'])) if( preg_match("/^[^\s]/i",$field_desc['null']))
$sqlfields[$i] .= " ".$field_desc['null']; $sqlfields[$i] .= " ".$field_desc['null'];
else if( preg_match("/^[^\s]/i",$field_desc['extra'])) if( preg_match("/^[^\s]/i",$field_desc['extra']))
$sqlfields[$i] .= " ".$field_desc['extra']; $sqlfields[$i] .= " ".$field_desc['extra'];
$i++; $i++;
} }
if($primary_key != "") if($primary_key != "")

View File

@ -879,22 +879,27 @@ class DoliDBMysqli
{ {
$sqlfields[$i] = $field_name." "; $sqlfields[$i] = $field_name." ";
$sqlfields[$i] .= $field_desc['type']; $sqlfields[$i] .= $field_desc['type'];
if( preg_match("/^[^\s]/i",$field_desc['value'])) if( preg_match("/^[^\s]/i",$field_desc['value']))
$sqlfields[$i] .= "(".$field_desc['value'].")"; $sqlfields[$i] .= "(".$field_desc['value'].")";
else if( preg_match("/^[^\s]/i",$field_desc['attribute']))
$sqlfields[$i] .= " ".$field_desc['attribute']; if( preg_match("/^[^\s]/i",$field_desc['attribute']))
else if( preg_match("/^[^\s]/i",$field_desc['default'])) $sqlfields[$i] .= " ".$field_desc['attribute'];
if( preg_match("/^[^\s]/i",$field_desc['default']))
{ {
if(preg_match("/null/i",$field_desc['default'])) if(preg_match("/null/i",$field_desc['default']))
$sqlfields[$i] .= " default ".$field_desc['default']; $sqlfields[$i] .= " default ".$field_desc['default'];
elseif ($field_desc['default'] == 'CURRENT_TIMESTAMP')
$sqlfields[$i] .= " default ".$field_desc['default'];
else else
$sqlfields[$i] .= " default '".$field_desc['default']."'"; $sqlfields[$i] .= " default '".$field_desc['default']."'";
} }
else if( preg_match("/^[^\s]/i",$field_desc['null'])) if( preg_match("/^[^\s]/i",$field_desc['null']))
$sqlfields[$i] .= " ".$field_desc['null']; $sqlfields[$i] .= " ".$field_desc['null'];
else if( preg_match("/^[^\s]/i",$field_desc['extra'])) if( preg_match("/^[^\s]/i",$field_desc['extra']))
$sqlfields[$i] .= " ".$field_desc['extra']; $sqlfields[$i] .= " ".$field_desc['extra'];
$i++; $i++;
} }
if($primary_key != "") if($primary_key != "")

View File

@ -88,7 +88,7 @@ if (! class_exists('MenuManager'))
} }
} }
$menumanager = new MenuManager($db, empty($user->societe_id)?0:1); $menumanager = new MenuManager($db, empty($user->societe_id)?0:1);
$menumanager->loadMenu(); $menumanager->loadMenu('all','all');
$menumanager->showmenu('jmobile'); $menumanager->showmenu('jmobile');

View File

@ -42,7 +42,7 @@ function dol_basename($pathfile)
* @param string $path Starting path from which to search * @param string $path Starting path from which to search
* @param string $types Can be "directories", "files", or "all" * @param string $types Can be "directories", "files", or "all"
* @param int $recursive Determines whether subdirectories are searched * @param int $recursive Determines whether subdirectories are searched
* @param string $filter Regex for include filter * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
* @param string $excludefilter Array of Regex for exclude filter (example: array('\.meta$','^\.')) * @param string $excludefilter Array of Regex for exclude filter (example: array('\.meta$','^\.'))
* @param string $sortcriteria Sort criteria ("","fullname","name","date","size") * @param string $sortcriteria Sort criteria ("","fullname","name","date","size")
* @param string $sortorder Sort order (SORT_ASC, SORT_DESC) * @param string $sortorder Sort order (SORT_ASC, SORT_DESC)
@ -1212,11 +1212,11 @@ function dol_uncompress($inputfile,$outputdir)
/** /**
* Return most recent file * Return file(s) into a directory (by default most recent)
* *
* @param string $dir Directory to scan * @param string $dir Directory to scan
* @param string $regexfilter Regexfilter * @param string $regexfilter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
* @param string $excludefilter Array of Regex for exclude filter (example: array('\.meta$','^\.')) * @param string $excludefilter Array of Regex for exclude filter (example: array('\.meta$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function
* @param int $nohook Disable all hooks * @param int $nohook Disable all hooks
* @return string Full path to most recent file * @return string Full path to most recent file
*/ */
@ -1225,4 +1225,5 @@ function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('\.meta$
$tmparray=dol_dir_list($dir,'files',0,$regexfilter,$excludefilter,'date',SORT_DESC,'',$nohook); $tmparray=dol_dir_list($dir,'files',0,$regexfilter,$excludefilter,'date',SORT_DESC,'',$nohook);
return $tmparray[0]; return $tmparray[0];
} }
?> ?>

View File

@ -1155,17 +1155,18 @@ function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64,$showinvalid=
* @param string $country Country code to use for formatting * @param string $country Country code to use for formatting
* @param int $cid Id of contact if known * @param int $cid Id of contact if known
* @param int $socid Id of third party if known * @param int $socid Id of third party if known
* @param int $addlink 0=no link to create action * @param int $addlink ''=no link to create action, 'AC_TEL'=add link to clicktodial (if module enabled) and add link to create event (if conf->global->AGENDA_ADDACTIONFORPHONE set)
* @param string $separ separation between numbers for a better visibility example : xx.xx.xx.xx.xx * @param string $separ Separation between numbers for a better visibility example : xx.xx.xx.xx.xx
* @return string Formated phone number * @return string Formated phone number
*/ */
function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$separ="&nbsp;") function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ="&nbsp;")
{ {
global $conf,$user,$langs; global $conf,$user,$langs,$mysoc;
// Clean phone parameter // Clean phone parameter
$phone = preg_replace("/[\s.-]/","",trim($phone)); $phone = preg_replace("/[\s.-]/","",trim($phone));
if (empty($phone)) { return ''; } if (empty($phone)) { return ''; }
if (empty($country)) $country=$mysoc->country_code;
$newphone=$phone; $newphone=$phone;
if (strtoupper($country) == "FR") if (strtoupper($country) == "FR")
@ -1198,8 +1199,11 @@ function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$separ=
{ {
if (empty($user->clicktodial_loaded)) $user->fetch_clicktodial(); if (empty($user->clicktodial_loaded)) $user->fetch_clicktodial();
if (empty($conf->global->CLICKTODIAL_URL)) $urlmask='ErrorClickToDialModuleNotConfigured'; // Define urlmask
else $urlmask=$conf->global->CLICKTODIAL_URL; $urlmask='ErrorClickToDialModuleNotConfigured';
if (! empty($conf->global->CLICKTODIAL_URL)) $urlmask=$conf->global->CLICKTODIAL_URL;
if (! empty($user->clicktodial_url)) $urlmask=$user->clicktodial_url;
$clicktodial_poste=(! empty($user->clicktodial_poste)?urlencode($user->clicktodial_poste):''); $clicktodial_poste=(! empty($user->clicktodial_poste)?urlencode($user->clicktodial_poste):'');
$clicktodial_login=(! empty($user->clicktodial_login)?urlencode($user->clicktodial_login):''); $clicktodial_login=(! empty($user->clicktodial_login)?urlencode($user->clicktodial_login):'');
$clicktodial_password=(! empty($user->clicktodial_password)?urlencode($user->clicktodial_password):''); $clicktodial_password=(! empty($user->clicktodial_password)?urlencode($user->clicktodial_password):'');
@ -1223,7 +1227,7 @@ function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$separ=
$type='AC_TEL'; $link=''; $type='AC_TEL'; $link='';
if ($addlink == 'AC_FAX') $type='AC_FAX'; if ($addlink == 'AC_FAX') $type='AC_FAX';
if (! empty($conf->global->AGENDA_ADDACTIONFORPHONE)) $link='<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&amp;backtopage=1&amp;actioncode='.$type.($cid?'&amp;contactid='.$cid:'').($socid?'&amp;socid='.$socid:'').'">'.img_object($langs->trans("AddAction"),"calendar").'</a>'; if (! empty($conf->global->AGENDA_ADDACTIONFORPHONE)) $link='<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&amp;backtopage=1&amp;actioncode='.$type.($cid?'&amp;contactid='.$cid:'').($socid?'&amp;socid='.$socid:'').'">'.img_object($langs->trans("AddAction"),"calendar").'</a>';
$newphone='<table class="nobordernopadding"><tr><td>'.$newphone.' </td><td>&nbsp;'.$link.'</td></tr></table>'; if ($link) $newphone='<table class="nobordernopadding"><tr><td>'.$newphone.' </td><td>&nbsp;'.$link.'</td></tr></table>';
} }
} }

View File

@ -8,16 +8,16 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__;
-- --
-- table llx_menu -- table llx_menu
-- --
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', 1__+MAX_llx_menu__, __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&amp;leftmenu=', 'Home', -1, '', '', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', 1__+MAX_llx_menu__, __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&amp;leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur', '$conf->societe->enabled || $conf->fournisseur->enabled', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&amp;leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur', '$conf->societe->enabled || $conf->fournisseur->enabled', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&amp;leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&amp;leftmenu=', 'Products/Services', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&amp;leftmenu=', 'Products/Services', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&amp;leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&amp;leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|facture|deplacement|don|tax', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&amp;leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->deplacement->lire || $user->rights->don->lire || $user->rights->tax->charges->lire', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|facture|deplacement|don|tax', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&amp;leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->deplacement->lire || $user->rights->don->lire || $user->rights->tax->charges->lire', '', 2, 50, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/index.php?mainmenu=bank&amp;leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 6, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/index.php?mainmenu=bank&amp;leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 60, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&amp;leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 7, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&amp;leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 70, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('mailing|export|import', '$conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&amp;leftmenu=', 'Tools', -1, 'other', '$user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run', '', 2, 8, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('mailing|export|import', '$conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&amp;leftmenu=', 'Tools', -1, 'other', '$user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run', '', 2, 80, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('boutique', '! empty($conf->boutique->enabled)', 11__+MAX_llx_menu__, __HANDLER__, 'top', 'shop', '', 0, '/boutique/index.php?mainmenu=shop&amp;leftmenu=', 'OSCommerce', -1, 'shop', '', '', 0, 11, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('boutique', '! empty($conf->boutique->enabled)', 11__+MAX_llx_menu__, __HANDLER__, 'top', 'shop', '', 0, '/boutique/index.php?mainmenu=shop&amp;leftmenu=', 'OSCommerce', -1, 'shop', '', '', 0, 90, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('adherent', '$conf->adherent->enabled', 13__+MAX_llx_menu__, __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&amp;leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 15, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('adherent', '$conf->adherent->enabled', 13__+MAX_llx_menu__, __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&amp;leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 100, __ENTITY__);
-- Home - Setup -- Home - Setup
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 100__+MAX_llx_menu__, 'home', 'setup', 1__+MAX_llx_menu__, '/admin/index.php?leftmenu=setup', 'Setup', 0, 'admin', '', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 100__+MAX_llx_menu__, 'home', 'setup', 1__+MAX_llx_menu__, '/admin/index.php?leftmenu=setup', 'Setup', 0, 'admin', '', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu==\'setup\'', __HANDLER__, 'left', 101__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/company.php?leftmenu=setup', 'MenuCompanySetup', 1, 'admin', '', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu==\'setup\'', __HANDLER__, 'left', 101__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/company.php?leftmenu=setup', 'MenuCompanySetup', 1, 'admin', '', '', 2, 1, __ENTITY__);
@ -30,7 +30,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu==\'setup\'', __HANDLER__, 'left', 110__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/limits.php?leftmenu=setup', 'MenuLimits', 1, 'admin', '', '', 2, 8, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu==\'setup\'', __HANDLER__, 'left', 110__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/limits.php?leftmenu=setup', 'MenuLimits', 1, 'admin', '', '', 2, 8, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu==\'setup\'', __HANDLER__, 'left', 107__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/pdf.php?leftmenu=setup', 'PDF', 1, 'admin', '', '', 2, 9, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu==\'setup\'', __HANDLER__, 'left', 107__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/pdf.php?leftmenu=setup', 'PDF', 1, 'admin', '', '', 2, 9, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu==\'setup\'', __HANDLER__, 'left', 109__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/mails.php?leftmenu=setup', 'Emails', 1, 'admin', '', '', 2, 10, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu==\'setup\'', __HANDLER__, 'left', 109__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/mails.php?leftmenu=setup', 'Emails', 1, 'admin', '', '', 2, 10, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu==\'setup\'', __HANDLER__, 'left', 113__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/sms.php?leftmenu=setup', 'Sms', 1, 'admin', '', '', 2, 11, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu==\'setup\'', __HANDLER__, 'left', 113__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/sms.php?leftmenu=setup', 'SMS', 1, 'admin', '', '', 2, 11, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu==\'setup\'', __HANDLER__, 'left', 111__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/dict.php?leftmenu=setup', 'DictionnarySetup', 1, 'admin', '', '', 2, 12, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu==\'setup\'', __HANDLER__, 'left', 111__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/dict.php?leftmenu=setup', 'DictionnarySetup', 1, 'admin', '', '', 2, 12, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu==\'setup\'', __HANDLER__, 'left', 112__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/const.php?leftmenu=setup', 'OtherSetup', 1, 'admin', '', '', 2, 13, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu==\'setup\'', __HANDLER__, 'left', 112__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/const.php?leftmenu=setup', 'OtherSetup', 1, 'admin', '', '', 2, 13, __ENTITY__);
-- Home - Sytem info -- Home - Sytem info

View File

@ -30,12 +30,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $atarget Target * @param string $atarget Target
* @param int $type_user 0=Internal,1=External,2=All * @param int $type_user 0=Menu for backoffice, 1=Menu for front office
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
* @param array &$menu Object Menu to return back list of menu entries * @param array &$menu Object Menu to return back list of menu entries
* @param int $noout Disable output (Initialise &$menu only).
* @return void * @return void
*/ */
function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu) function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
{ {
global $user,$conf,$langs,$dolibarr_main_db_name; global $user,$conf,$langs,$dolibarr_main_db_name;
@ -45,11 +46,11 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu)
$id='mainmenu'; $id='mainmenu';
$listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL); $listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL);
//$tabMenu=array(); // Show personalized menus
$menuArbo = new Menubase($db,'auguria'); $menuArbo = new Menubase($db,'auguria');
$newTabMenu = $menuArbo->menuTopCharger('', '', $type_user, 'auguria',$tabMenu); $newTabMenu = $menuArbo->menuTopCharger('', '', $type_user, 'auguria',$tabMenu);
print_start_menu_array_auguria(); if (empty($noout)) print_start_menu_array_auguria();
$num = count($newTabMenu); $num = count($newTabMenu);
for($i = 0; $i < $num; $i++) for($i = 0; $i < $num; $i++)
@ -59,23 +60,24 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu)
$showmode=dol_auguria_showmenu($type_user,$newTabMenu[$i],$listofmodulesforexternal); $showmode=dol_auguria_showmenu($type_user,$newTabMenu[$i],$listofmodulesforexternal);
if ($showmode == 1) if ($showmode == 1)
{ {
// Define url $url = $shorturl = $newTabMenu[$i]['url'];
if (preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url'])) if (! preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url']))
{ {
$url = $newTabMenu[$i]['url']; $param='';
}
else
{
$url=dol_buildpath($newTabMenu[$i]['url'],1);
if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url)) if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url))
{ {
if (! preg_match('/\?/',$url)) $url.='?'; if (! preg_match('/\?/',$url)) $param.='?';
else $url.='&'; else $param.='&';
$url.='mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu='; $param.='mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu=';
} }
//$url.="idmenu=".$newTabMenu[$i]['rowid']; // Already done by menuLoad //$url.="idmenu=".$newTabMenu[$i]['rowid']; // Already done by menuLoad
$url=dol_buildpath($url,1).$param;
$shorturl = $newTabMenu[$i]['url'].$param;
} }
$url=preg_replace('/__LOGIN__/',$user->login,$url); $url=preg_replace('/__LOGIN__/',$user->login,$url);
$shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl);
$url=preg_replace('/__USERID__/',$user->id,$url);
$shorturl=preg_replace('/__USERID__/',$user->id,$shorturl);
// Define the class (top menu selected or not) // Define the class (top menu selected or not)
if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"'; if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"';
@ -84,12 +86,13 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu)
} }
else if ($showmode == 2) $classname='class="tmenu"'; else if ($showmode == 2) $classname='class="tmenu"';
print_start_menu_entry_auguria($idsel,$classname,$showmode); if (empty($noout)) print_start_menu_entry_auguria($idsel,$classname,$showmode);
print_text_menu_entry_auguria($newTabMenu[$i]['titre'], $showmode, $url, $id, $idsel, $classname, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget)); if (empty($noout)) print_text_menu_entry_auguria($newTabMenu[$i]['titre'], $showmode, $url, $id, $idsel, $classname, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget));
print_end_menu_entry_auguria($showmode); if (empty($noout)) print_end_menu_entry_auguria($showmode);
$menu->add($shorturl, $newTabMenu[$i]['titre'], 0, $showmode, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget), ($newTabMenu[$i]['mainmenu']?$newTabMenu[$i]['mainmenu']:$newTabMenu[$i]['rowid']), '');
} }
print_end_menu_array_auguria(); if (empty($noout)) print_end_menu_array_auguria();
print "\n"; print "\n";
} }
@ -127,7 +130,7 @@ function print_start_menu_entry_auguria($idsel,$classname,$showmode)
* Output menu entry * Output menu entry
* *
* @param string $text Text * @param string $text Text
* @param int $showmode 1 = allowed or 2 = not allowed * @param int $showmode 0 = hide, 1 = allowed or 2 = not allowed
* @param string $url Url * @param string $url Url
* @param string $id Id * @param string $id Id
* @param string $idsel Id sel * @param string $idsel Id sel
@ -142,7 +145,7 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla
if ($showmode == 1) if ($showmode == 1)
{ {
print '<a class="tmenuimage" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; print '<a class="tmenuimage" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>';
print '<div class="'.$id.' '.$idsel.'"><span class="mainmenu_'.$idsel.' '.$id.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>'; print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>';
print '</a>'; print '</a>';
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>';
print '<span class="mainmenuaspan">'; print '<span class="mainmenuaspan">';
@ -152,7 +155,7 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla
} }
if ($showmode == 2) if ($showmode == 2)
{ {
print '<div class="'.$id.' '.$idsel.'"><span class="mainmenu_'.$idsel.' '.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>'; print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>';
print '<a class="tmenudisabled" id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'; print '<a class="tmenudisabled" id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">';
print '<span class="mainmenuaspan">'; print '<span class="mainmenuaspan">';
print $text; print $text;
@ -172,8 +175,8 @@ function print_end_menu_entry_auguria($showmode)
if ($showmode) if ($showmode)
{ {
print '</div></li>'; print '</div></li>';
print "\n";
} }
print "\n";
} }
/** /**
@ -198,20 +201,22 @@ function print_end_menu_array_auguria()
* @param array $menu_array_after Table of menu entries to show after entries of menu handler * @param array $menu_array_after Table of menu entries to show after entries of menu handler
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
* @param array &$menu Object Menu to return back list of menu entries * @param array &$menu Object Menu to return back list of menu entries
* @param int $noout Disable output (Initialise &$menu only).
* @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x'
* @param string $forceleftmenu 'all'=Force leftmenu to '' (= all)
* @return void * @return void
*/ */
function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu) function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu,$noout=0,$forcemainmenu='',$forceleftmenu='')
{ {
global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc; global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc;
$overwritemenufor = array();
$newmenu = $menu; $newmenu = $menu;
$mainmenu=$_SESSION["mainmenu"]; $mainmenu=($forcemainmenu?$forcemainmenu:$_SESSION["mainmenu"]);
$leftmenu=$_SESSION["leftmenu"]; $leftmenu=($forceleftmenu?'':(empty($_SESSION["leftmenu"])?'none':$_SESSION["leftmenu"]));
// Show logo company // Show logo company
if (! empty($conf->global->MAIN_SHOW_LOGO)) if (empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO))
{ {
$mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; $mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
@ -245,23 +250,21 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
if (! is_array($menu_array)) return 0; if (! is_array($menu_array)) return 0;
// Show menu // Show menu
if (empty($noout))
{
$alt=0; $alt=0;
$num=count($menu_array); $num=count($menu_array);
for ($i = 0; $i < $num; $i++) for ($i = 0; $i < $num; $i++)
{ {
$showmenu=true;
if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($menu_array[$i]['enabled'])) $showmenu=false;
$alt++; $alt++;
if (empty($menu_array[$i]['level'])) if (empty($menu_array[$i]['level']) && $showmenu)
{ {
if (($alt%2==0)) if (($alt%2==0))
{ {
if ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_MENU_USE_JQUERY_ACCORDION)) print '<div class="blockvmenuimpair">'."\n";
{
print '<div class="blockvmenupair">'."\n";
}
else
{
print '<div class="blockvmenuimpair">'."\n";
}
} }
else else
{ {
@ -282,6 +285,8 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
// Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser. // Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser.
$url=dol_buildpath($menu_array[$i]['url'],1); $url=dol_buildpath($menu_array[$i]['url'],1);
$url=preg_replace('/__LOGIN__/',$user->login,$url);
$url=preg_replace('/__USERID__/',$user->id,$url);
if (! preg_match('/mainmenu=/i',$menu_array[$i]['url'])) if (! preg_match('/mainmenu=/i',$menu_array[$i]['url']))
{ {
@ -290,7 +295,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
$url.='mainmenu='.$mainmenu; $url.='mainmenu='.$mainmenu;
} }
print '<!-- Add menu entry with mainmenu='.$menu_array[$i]['mainmenu'].', leftmenu='.$menu_array[$i]['leftmenu'].', level='.$menu_array[$i]['mainmenu'].' -->'."\n"; print '<!-- Add menu entry with mainmenu='.$menu_array[$i]['mainmenu'].', leftmenu='.$menu_array[$i]['leftmenu'].', level='.$menu_array[$i]['level'].' -->'."\n";
// Menu niveau 0 // Menu niveau 0
if ($menu_array[$i]['level'] == 0) if ($menu_array[$i]['level'] == 0)
@ -299,34 +304,41 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
{ {
print '<div class="menu_titre">'.$tabstring.'<a class="vmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>'.$menu_array[$i]['titre'].'</a></div>'; print '<div class="menu_titre">'.$tabstring.'<a class="vmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>'.$menu_array[$i]['titre'].'</a></div>';
} }
else if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) else if ($showmenu)
{ {
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$menu_array[$i]['titre'].'</font></div>'; print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$menu_array[$i]['titre'].'</font></div>'."\n";
} }
print "\n".'<div id="section_content_'.$i.'">'."\n"; if ($showmenu)
print '<div class="menu_top"></div>'."\n"; print '<div class="menu_top"></div>'."\n";
} }
// Menu niveau > 0 // Menu niveau > 0
if ($menu_array[$i]['level'] > 0) if ($menu_array[$i]['level'] > 0)
{ {
if ($menu_array[$i]['enabled']) if ($menu_array[$i]['enabled'])
{ {
print '<div class="menu_contenu">'.$tabstring.'<a class="vsmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>'.$menu_array[$i]['titre'].'</a></div>'; print '<div class="menu_contenu">'.$tabstring;
if ($menu_array[$i]['url']) print '<a class="vsmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>';
print $menu_array[$i]['titre'];
if ($menu_array[$i]['url']) print '</a>';
// If title is not pure text and contains a table, no carriage return added
if (! strstr($menu_array[$i]['titre'],'<table')) print '<br>';
print '</div>'."\n";
} }
else if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) else if ($showmenu)
{ {
print '<div class="menu_contenu">'.$tabstring.'<font class="vsmenudisabled">'.$menu_array[$i]['titre'].'</font></div>'; print '<div class="menu_contenu">'.$tabstring.'<font class="vsmenudisabled">'.$menu_array[$i]['titre'].'</font><br></div>'."\n";
} }
} }
// If next is a new block or end // If next is a new block or end
if (empty($menu_array[$i+1]['level'])) if (empty($menu_array[$i+1]['level']))
{ {
print '<div class="menu_end"></div>'."\n"; if ($showmenu)
print "</div><!-- end section content -->\n"; print '<div class="menu_end"></div>'."\n";
print "</div><!-- end blockvmenu pair/impair -->\n"; print "</div>\n";
} }
} }
}
return count($menu_array); return count($menu_array);
} }

View File

@ -55,9 +55,11 @@ class MenuManager
/** /**
* Load this->tabMenu * Load this->tabMenu
* *
* @param string $forcemainmenu To force mainmenu to load
* @param string $forceleftmenu To force leftmenu to load
* @return void * @return void
*/ */
function loadMenu() function loadMenu($forcemainmenu='',$forceleftmenu='')
{ {
global $conf, $user, $langs; global $conf, $user, $langs;
@ -78,6 +80,7 @@ class MenuManager
// On va le chercher en session si non defini par le lien // On va le chercher en session si non defini par le lien
$mainmenu=isset($_SESSION["mainmenu"])?$_SESSION["mainmenu"]:''; $mainmenu=isset($_SESSION["mainmenu"])?$_SESSION["mainmenu"]:'';
} }
if (! empty($forcemainmenu)) $mainmenu=$forcemainmenu;
if (isset($_GET["leftmenu"])) if (isset($_GET["leftmenu"]))
{ {
@ -98,6 +101,7 @@ class MenuManager
// On va le chercher en session si non defini par le lien // On va le chercher en session si non defini par le lien
$leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:''; $leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:'';
} }
if (! empty($forceleftmenu)) $leftmenu=$forceleftmenu;
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
$tabMenu=array(); $tabMenu=array();
@ -151,12 +155,12 @@ class MenuManager
/** /**
* Show menu * Show menu
* *
* @param string $mode 'top' or 'left' * @param string $mode 'top', 'left', 'jmobile'
* @return int Number of menu entries shown * @return int Number of menu entries shown
*/ */
function showmenu($mode) function showmenu($mode)
{ {
global $conf; global $conf, $langs;
require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria.lib.php';
@ -173,6 +177,60 @@ class MenuManager
if ($mode == 'top') $res=print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu); if ($mode == 'top') $res=print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu);
if ($mode == 'left') $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu); if ($mode == 'left') $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu);
if ($mode == 'jmobile')
{
$res=print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,1);
foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
{
print '<ul data-role="listview" data-inset="true">';
print '<li data-role="list-divider">';
if ($val['enabled'] == 1)
{
$relurl=dol_buildpath($val['url'],1);
print '<a href="#">'.$val['titre'].'</a>'."\n";
// Search submenu fot this entry
$tmpmainmenu=$val['mainmenu'];
$tmpleftmenu='all';
$submenu=new Menu();
//var_dump($tmpmainmenu.' - '.$tmpleftmenu);
$res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu);
//var_dump($submenu->liste);
$nexturl=dol_buildpath($submenu->liste[0]['url'],1);
$canonrelurl=preg_replace('/\?.*$/','',$relurl);
$canonnexturl=preg_replace('/\?.*$/','',$nexturl);
//var_dump($canonrelurl);
//var_dump($canonnexturl);
print '<ul>';
if ($canonrelurl != $canonnexturl && $val['mainmenu'] != 'home')
{
// We add sub entry
print '<li data-role="list-divider"><a href="'.$relurl.'">'.$langs->trans("MainArea").'-'.$val['titre'].'</a></li>'."\n";
}
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
{
$relurl2=dol_buildpath($val2['url'],1);
$canonurl2=preg_replace('/\?.*$/','',$val2['url']);
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php'))) $relurl2='';
print '<li'.($val2['level']==0?' data-role="list-divider"':'').'>';
if ($relurl2) print '<a href="'.$relurl2.'">';
print $val2['titre'];
if ($relurl2) print '</a>';
print '</li>'."\n";
}
//var_dump($submenu);
print '</ul>';
}
if ($val['enabled'] == 2)
{
print '<font class="vsmenudisabled">'.$val['titre'].'</font>';
}
print '</li>';
print '</ul>'."\n";
}
}
unset($this->menu); unset($this->menu);

View File

@ -264,10 +264,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
$showmode=dol_eldy_showmenu($type_user,$newTabMenu[$i],$listofmodulesforexternal); $showmode=dol_eldy_showmenu($type_user,$newTabMenu[$i],$listofmodulesforexternal);
if ($showmode == 1) if ($showmode == 1)
{ {
$url = $newTabMenu[$i]['url']; $url = $shorturl = $newTabMenu[$i]['url'];
if (! preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url'])) if (! preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url']))
{ {
$url = $newTabMenu[$i]['url'];
$param=''; $param='';
if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url)) if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url))
{ {
@ -281,6 +280,8 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
} }
$url=preg_replace('/__LOGIN__/',$user->login,$url); $url=preg_replace('/__LOGIN__/',$user->login,$url);
$shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl); $shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl);
$url=preg_replace('/__USERID__/',$user->id,$url);
$shorturl=preg_replace('/__USERID__/',$user->id,$shorturl);
// Define the class (top menu selected or not) // Define the class (top menu selected or not)
if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"'; if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"';
@ -414,7 +415,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu = $menu; $newmenu = $menu;
$mainmenu=($forcemainmenu?$forcemainmenu:$_SESSION["mainmenu"]); $mainmenu=($forcemainmenu?$forcemainmenu:$_SESSION["mainmenu"]);
$leftmenu=($forceleftmenu?'':$_SESSION["leftmenu"]); $leftmenu=($forceleftmenu?'':(empty($_SESSION["leftmenu"])?'none':$_SESSION["leftmenu"]));
// Show logo company // Show logo company
if (empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO)) if (empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO))
@ -436,8 +437,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
} }
/** /**
* On definit newmenu en fonction de mainmenu et leftmenu * We update newmenu with entries found into database
* ------------------------------------------------------ * --------------------------------------------------
*/ */
if ($mainmenu) if ($mainmenu)
{ {
@ -1207,6 +1208,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
// For external modules // For external modules
$url = dol_buildpath($menu_array[$i]['url'], 1); $url = dol_buildpath($menu_array[$i]['url'], 1);
$url=preg_replace('/__LOGIN__/',$user->login,$url);
$url=preg_replace('/__USERID__/',$user->id,$url);
print '<!-- Add menu entry with mainmenu='.$menu_array[$i]['mainmenu'].', leftmenu='.$menu_array[$i]['leftmenu'].', level='.$menu_array[$i]['level'].' -->'."\n"; print '<!-- Add menu entry with mainmenu='.$menu_array[$i]['mainmenu'].', leftmenu='.$menu_array[$i]['leftmenu'].', level='.$menu_array[$i]['level'].' -->'."\n";

View File

@ -54,9 +54,11 @@ class MenuManager
/** /**
* Load this->tabMenu * Load this->tabMenu
* *
* @param string $forcemainmenu To force mainmenu to load
* @param string $forceleftmenu To force leftmenu to load
* @return void * @return void
*/ */
function loadMenu() function loadMenu($forcemainmenu='',$forceleftmenu='')
{ {
// On sauve en session le menu principal choisi // On sauve en session le menu principal choisi
if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"]; if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"];
@ -75,6 +77,7 @@ class MenuManager
// On va le chercher en session si non defini par le lien // On va le chercher en session si non defini par le lien
$mainmenu=isset($_SESSION["mainmenu"])?$_SESSION["mainmenu"]:''; $mainmenu=isset($_SESSION["mainmenu"])?$_SESSION["mainmenu"]:'';
} }
if (! empty($forcemainmenu)) $mainmenu=$forcemainmenu;
if (isset($_GET["leftmenu"])) if (isset($_GET["leftmenu"]))
{ {
@ -95,6 +98,7 @@ class MenuManager
// On va le chercher en session si non defini par le lien // On va le chercher en session si non defini par le lien
$leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:''; $leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:'';
} }
if (! empty($forceleftmenu)) $leftmenu=$forceleftmenu;
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
$tabMenu=array(); $tabMenu=array();

View File

@ -990,7 +990,7 @@ abstract class DolibarrModules
//print 'xxx'.$this->menu[$key]['fk_menu'];exit; //print 'xxx'.$this->menu[$key]['fk_menu'];exit;
$foundparent=0; $foundparent=0;
$fk_parent=$this->menu[$key]['fk_menu']; $fk_parent=$this->menu[$key]['fk_menu'];
if (preg_match('/r=/',$fk_parent)) if (preg_match('/^r=/',$fk_parent)) // old deprecated method
{ {
$fk_parent=str_replace('r=','',$fk_parent); $fk_parent=str_replace('r=','',$fk_parent);
if (isset($this->menu[$fk_parent]['rowid'])) if (isset($this->menu[$fk_parent]['rowid']))
@ -999,14 +999,14 @@ abstract class DolibarrModules
$foundparent=1; $foundparent=1;
} }
} }
elseif (preg_match('/fk_mainmenu=(.*),fk_leftmenu=(.*)/',$fk_parent,$reg)) elseif (preg_match('/^fk_mainmenu=([a-zA-Z0-9_]+),fk_leftmenu=([a-zA-Z0-9_]+)$/',$fk_parent,$reg))
{ {
$menu->fk_menu=-1; $menu->fk_menu=-1;
$menu->fk_mainmenu=$reg[1]; $menu->fk_mainmenu=$reg[1];
$menu->fk_leftmenu=$reg[2]; $menu->fk_leftmenu=$reg[2];
$foundparent=1; $foundparent=1;
} }
elseif (preg_match('/fk_mainmenu=(.*)/',$fk_parent,$reg)) elseif (preg_match('/^fk_mainmenu=([a-zA-Z0-9_]+)$/',$fk_parent,$reg))
{ {
$menu->fk_menu=-1; $menu->fk_menu=-1;
$menu->fk_mainmenu=$reg[1]; $menu->fk_mainmenu=$reg[1];

View File

@ -105,8 +105,9 @@ class doc_generic_order_odt extends ModelePDFCommandes
'object_date'=>dol_print_date($object->date,'day'), 'object_date'=>dol_print_date($object->date,'day'),
'object_date_delivery'=>dol_print_date($object->date_livraison,'dayhour'), 'object_date_delivery'=>dol_print_date($object->date_livraison,'dayhour'),
'object_date_creation'=>dol_print_date($object->date_creation,'day'), 'object_date_creation'=>dol_print_date($object->date_creation,'day'),
'object_date_modification'=>dol_print_date($object->date_modification,'day'), 'object_date_modification'=>(! empty($object->date_modification)?dol_print_date($object->date_modification,'day'):''),
'object_date_validation'=>dol_print_date($object->date_validation,'dayhour'), 'object_date_validation'=>(! empty($object->date_validation)?dol_print_date($object->date_validation,'dayhour'):''),
'object_date_delivery_planed'=>(! empty($object->date_livraison)?dol_print_date($object->date_livraison,'day'):''),
'object_date_close'=>dol_print_date($object->date_cloture,'dayhour'), 'object_date_close'=>dol_print_date($object->date_cloture,'dayhour'),
'object_payment_mode_code'=>$object->mode_reglement_code, 'object_payment_mode_code'=>$object->mode_reglement_code,
'object_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code)!='PaymentType'.$object->mode_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code):$object->mode_reglement), 'object_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code)!='PaymentType'.$object->mode_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code):$object->mode_reglement),

View File

@ -116,7 +116,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures
'object_date_limit'=>dol_print_date($object->date_lim_reglement,'day'), 'object_date_limit'=>dol_print_date($object->date_lim_reglement,'day'),
'object_date_creation'=>dol_print_date($object->date_creation,'day'), 'object_date_creation'=>dol_print_date($object->date_creation,'day'),
'object_date_modification'=>(! empty($object->date_modification)?dol_print_date($object->date_modification,'day'):''), 'object_date_modification'=>(! empty($object->date_modification)?dol_print_date($object->date_modification,'day'):''),
'object_date_validation'=>dol_print_date($object->date_validation,'dayhour'), 'object_date_validation'=>(! empty($object->date_validation)?dol_print_date($object->date_validation,'dayhour'):''),
'object_date_delivery_planed'=>(! empty($object->date_livraison)?dol_print_date($object->date_livraison,'day'):''),
'object_payment_mode_code'=>$object->mode_reglement_code, 'object_payment_mode_code'=>$object->mode_reglement_code,
'object_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code)!='PaymentType'.$object->mode_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code):$object->mode_reglement), 'object_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code)!='PaymentType'.$object->mode_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code):$object->mode_reglement),
'object_payment_term_code'=>$object->cond_reglement_code, 'object_payment_term_code'=>$object->cond_reglement_code,
@ -415,6 +416,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_propal=is_object($propal_object)?$this->get_substitutionarray_propal($propal_object,$outputlangs,'propal'):array(); $array_propal=is_object($propal_object)?$this->get_substitutionarray_propal($propal_object,$outputlangs,'propal'):array();
$array_other=$this->get_substitutionarray_other($user,$outputlangs);
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);

View File

@ -1405,7 +1405,7 @@ else
{ {
$ref = dol_sanitizeFileName($object->ref); $ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($object->ref,'/')); $fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
// Build document if it not exists // Build document if it not exists
@ -1428,7 +1428,7 @@ else
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($object->ref,'/')); $fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
} }

View File

@ -275,7 +275,7 @@ else dol_print_error($db);
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -1465,7 +1465,7 @@ else if ($id > 0 || ! empty($ref))
{ {
$ref = dol_sanitizeFileName($object->ref); $ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($object->ref,'/')); $fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
// Build document if it not exists // Build document if it not exists
@ -1488,7 +1488,7 @@ else if ($id > 0 || ! empty($ref))
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($object->ref,'/')); $fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
} }

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005 Marc Barilley <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -40,7 +41,7 @@ class FactureFournisseur extends CommonInvoice
public $fk_element='fk_facture_fourn'; public $fk_element='fk_facture_fourn';
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 $ref; // TODO deprecated var $ref;
var $product_ref; var $product_ref;
var $ref_supplier; var $ref_supplier;
var $socid; var $socid;
@ -132,7 +133,8 @@ class FactureFournisseur extends CommonInvoice
$totalht = ($amount - $remise); $totalht = ($amount - $remise);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."facture_fourn ("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."facture_fourn (";
$sql.= "facnumber"; $sql.= "ref";
$sql.= ", facnumber";
$sql.= ", entity"; $sql.= ", entity";
$sql.= ", libelle"; $sql.= ", libelle";
$sql.= ", fk_soc"; $sql.= ", fk_soc";
@ -144,7 +146,8 @@ class FactureFournisseur extends CommonInvoice
$sql.= ", date_lim_reglement"; $sql.= ", date_lim_reglement";
$sql.= ")"; $sql.= ")";
$sql.= " VALUES ("; $sql.= " VALUES (";
$sql.= "'".$this->db->escape($number)."'"; $sql.= "'(PROV)'";
$sql.= ", '".$this->db->escape($number)."'";
$sql.= ", ".$conf->entity; $sql.= ", ".$conf->entity;
$sql.= ", '".$this->db->escape($this->libelle)."'"; $sql.= ", '".$this->db->escape($this->libelle)."'";
$sql.= ", ".$this->socid; $sql.= ", ".$this->socid;
@ -259,6 +262,7 @@ class FactureFournisseur extends CommonInvoice
$sql = "SELECT"; $sql = "SELECT";
$sql.= " t.rowid,"; $sql.= " t.rowid,";
$sql.= " t.ref,";
$sql.= " t.facnumber,"; $sql.= " t.facnumber,";
$sql.= " t.entity,"; $sql.= " t.entity,";
$sql.= " t.type,"; $sql.= " t.type,";
@ -294,7 +298,7 @@ class FactureFournisseur extends CommonInvoice
$sql.= ' s.nom as socnom, s.rowid as socid'; $sql.= ' s.nom as socnom, s.rowid as socid';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as t,'.MAIN_DB_PREFIX.'societe as s'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as t,'.MAIN_DB_PREFIX.'societe as s';
if ($id) $sql.= " WHERE t.rowid=".$id; if ($id) $sql.= " WHERE t.rowid=".$id;
if ($ref) $sql.= " WHERE t.rowid='".$this->db->escape($ref)."'"; // ref is id (facnumber is supplier ref) if ($ref) $sql.= " WHERE t.ref='".$this->db->escape($ref)."'"; // ref is id (facnumber is supplier ref)
$sql.= ' AND t.fk_soc = s.rowid'; $sql.= ' AND t.fk_soc = s.rowid';
dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
@ -306,7 +310,7 @@ class FactureFournisseur extends CommonInvoice
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref = $obj->rowid; $this->ref = $obj->ref;
$this->ref_supplier = $obj->facnumber; $this->ref_supplier = $obj->facnumber;
$this->facnumber = $obj->facnumber; $this->facnumber = $obj->facnumber;
@ -459,6 +463,7 @@ class FactureFournisseur extends CommonInvoice
$error=0; $error=0;
// Clean parameters // Clean parameters
if (isset($this->ref)) $this->ref=trim($this->ref);
if (isset($this->ref_supplier)) $this->ref_supplier=trim($this->ref_supplier); if (isset($this->ref_supplier)) $this->ref_supplier=trim($this->ref_supplier);
if (isset($this->entity)) $this->entity=trim($this->entity); if (isset($this->entity)) $this->entity=trim($this->entity);
if (isset($this->type)) $this->type=trim($this->type); if (isset($this->type)) $this->type=trim($this->type);
@ -495,6 +500,7 @@ class FactureFournisseur extends CommonInvoice
// Update request // Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn SET";
$sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").",";
$sql.= " facnumber=".(isset($this->facnumber)?"'".$this->db->escape($this->facnumber)."'":"null").","; $sql.= " facnumber=".(isset($this->facnumber)?"'".$this->db->escape($this->facnumber)."'":"null").",";
$sql.= " entity=".(isset($this->entity)?$this->entity:"null").","; $sql.= " entity=".(isset($this->entity)?$this->entity:"null").",";
$sql.= " type=".(isset($this->type)?$this->type:"null").","; $sql.= " type=".(isset($this->type)?$this->type:"null").",";
@ -834,7 +840,7 @@ class FactureFournisseur extends CommonInvoice
} }
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn"; $sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn";
$sql.= " SET fk_statut = 1, fk_user_valid = ".$user->id; $sql.= " SET ref='".$num."', fk_statut = 1, fk_user_valid = ".$user->id;
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::validate sql=".$sql); dol_syslog(get_class($this)."::validate sql=".$sql);

View File

@ -1855,7 +1855,7 @@ elseif (! empty($object->id))
{ {
$ref = dol_sanitizeFileName($object->ref); $ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/')); $fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
// Build document if it not exists // Build document if it not exists
@ -1878,7 +1878,7 @@ elseif (! empty($object->id))
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/')); $fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
} }

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005 Marc Barilley <marc@ocebo.fr> * Copyright (C) 2005 Marc Barilley <marc@ocebo.fr>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -49,6 +50,7 @@ $errors=array();
$id = (GETPOST('facid','int') ? GETPOST('facid','int') : GETPOST('id','int')); $id = (GETPOST('facid','int') ? GETPOST('facid','int') : GETPOST('id','int'));
$action = GETPOST("action"); $action = GETPOST("action");
$confirm = GETPOST("confirm"); $confirm = GETPOST("confirm");
$ref = GETPOST('ref','alpha');
//PDF //PDF
$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); $hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
@ -65,6 +67,12 @@ $hookmanager->initHooks(array('invoicesuppliercard'));
$object=new FactureFournisseur($db); $object=new FactureFournisseur($db);
// Load object
if ($id > 0 || ! empty($ref))
{
$ret=$object->fetch($id, $ref);
}
/* /*
@ -258,7 +266,8 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer)
$db->begin(); $db->begin();
// Creation facture // Creation facture
$object->ref = $_POST['facnumber']; $object->ref = $_POST['ref'];
$object->facnumber = $_POST['facnumber'];
$object->socid = $_POST['socid']; $object->socid = $_POST['socid'];
$object->libelle = $_POST['libelle']; $object->libelle = $_POST['libelle'];
$object->date = $datefacture; $object->date = $datefacture;
@ -1281,6 +1290,22 @@ else
// Confirmation de la validation // Confirmation de la validation
if ($action == 'valid') if ($action == 'valid')
{ {
// on verifie si l'objet est en numerotation provisoire
$objectref = substr($object->ref, 1, 4);
if ($objectref == 'PROV')
{
$savdate=$object->date;
if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION))
{
$object->date=dol_now();
$object->date_lim_reglement=$object->calculate_date_lim_reglement();
}
$numref = $object->getNextNumRef($soc);
}
else
{
$numref = $object->ref;
}
$formquestion=array(); $formquestion=array();
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $object->hasProductsOrServices(1)) if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $object->hasProductsOrServices(1))
{ {
@ -1322,7 +1347,7 @@ else
// Ref // Ref
print '<tr><td nowrap="nowrap" width="20%">'.$langs->trans("Ref").'</td><td colspan="4">'; print '<tr><td nowrap="nowrap" width="20%">'.$langs->trans("Ref").'</td><td colspan="4">';
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref'); print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
@ -2046,7 +2071,7 @@ else
{ {
$ref = dol_sanitizeFileName($object->ref); $ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($object->ref,'/')); $fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
// Build document if it not exists // Build document if it not exists
@ -2069,7 +2094,7 @@ else
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($object->ref,'/')); $fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($ref,'/'));
$file=$fileparams['fullname']; $file=$fileparams['fullname'];
} }

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -102,7 +103,7 @@ $htmlother=new FormOther($db);
llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores'); llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
$sql = "SELECT s.rowid as socid, s.nom, "; $sql = "SELECT s.rowid as socid, s.nom, ";
$sql.= " fac.rowid as ref, fac.rowid as facid, fac.facnumber, fac.datef, fac.date_lim_reglement as date_echeance,"; $sql.= " fac.rowid as facid, fac.ref, fac.facnumber, fac.datef, fac.date_lim_reglement as date_echeance,";
$sql.= " fac.total_ht, fac.total_ttc, fac.paye as paye, fac.fk_statut as fk_statut, fac.libelle"; $sql.= " fac.total_ht, fac.total_ttc, fac.paye as paye, fac.fk_statut as fk_statut, fac.libelle";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as fac"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as fac";

View File

@ -321,7 +321,7 @@ if (count($companystatic->SupplierCategories))
//print "</td></tr></table>\n"; //print "</td></tr></table>\n";
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -267,10 +267,17 @@ class Holiday extends CommonObject
$sql.= " cp.fk_user_refuse,"; $sql.= " cp.fk_user_refuse,";
$sql.= " cp.date_cancel,"; $sql.= " cp.date_cancel,";
$sql.= " cp.fk_user_cancel,"; $sql.= " cp.fk_user_cancel,";
$sql.= " cp.detail_refuse"; $sql.= " cp.detail_refuse,";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp"; $sql.= " uu.lastname as user_lastname,";
$sql.= " WHERE cp.fk_user = '".$user_id."'"; $sql.= " uu.firstname as user_firstname,";
$sql.= " ua.lastname as validator_lastname,";
$sql.= " ua.firstname as validator_firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp, ".MAIN_DB_PREFIX."user as uu, ".MAIN_DB_PREFIX."user as ua";
$sql.= " WHERE cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau
$sql.= " AND cp.fk_user = '".$user_id."'";
// Filtre de séléction // Filtre de séléction
if(!empty($filter)) { if(!empty($filter)) {
@ -320,6 +327,12 @@ class Holiday extends CommonObject
$tab_result[$i]['fk_user_cancel'] = $obj->fk_user_cancel; $tab_result[$i]['fk_user_cancel'] = $obj->fk_user_cancel;
$tab_result[$i]['detail_refuse'] = $obj->detail_refuse; $tab_result[$i]['detail_refuse'] = $obj->detail_refuse;
$tab_result[$i]['user_firstname'] = $obj->user_firstname;
$tab_result[$i]['user_lastname'] = $obj->user_lastname;
$tab_result[$i]['validator_firstname'] = $obj->validator_firstname;
$tab_result[$i]['validator_lastname'] = $obj->validator_lastname;
$i++; $i++;
} }

View File

@ -48,6 +48,9 @@ alter table llx_contratdet add column buy_price_ht double(24,8) DEFAULT 0 after
-- serialised array, to store value of select list choices for example -- serialised array, to store value of select list choices for example
alter table llx_extrafields add column param text after pos; alter table llx_extrafields add column param text after pos;
-- numbering on supplier invoice
alter table llx_facture_fourn add column ref varchar(30) NOT NULL after rowid;
alter table llx_propal CHANGE COLUMN fk_adresse_livraison fk_delivery_address integer; alter table llx_propal CHANGE COLUMN fk_adresse_livraison fk_delivery_address integer;
alter table llx_commande CHANGE COLUMN fk_adresse_livraison fk_delivery_address integer; alter table llx_commande CHANGE COLUMN fk_adresse_livraison fk_delivery_address integer;
@ -206,5 +209,4 @@ ALTER TABLE llx_user ADD COLUMN fk_state integer DEFAULT 0;
ALTER TABLE llx_user ADD COLUMN fk_country integer DEFAULT 0; ALTER TABLE llx_user ADD COLUMN fk_country integer DEFAULT 0;
ALTER TABLE llx_user_clicktodial ADD COLUMN url varchar(255);

View File

@ -22,6 +22,7 @@
create table llx_user_clicktodial create table llx_user_clicktodial
( (
fk_user integer PRIMARY KEY, fk_user integer PRIMARY KEY,
url varchar(255),
login varchar(32), login varchar(32),
pass varchar(64), pass varchar(64),
poste varchar(20) poste varchar(20)

View File

@ -115,7 +115,7 @@ ErrorFileMustBeADolibarrPackage=Файлове %s трябва да бъде ц
ErrorFileRequired=Отнема файла пакет Dolibarr ErrorFileRequired=Отнема файла пакет Dolibarr
ErrorPhpCurlNotInstalled=PHP навийте не е инсталиран, това е от съществено значение, за да разговаря с Paypal ErrorPhpCurlNotInstalled=PHP навийте не е инсталиран, това е от съществено значение, за да разговаря с Paypal
ErrorFailedToAddToMailmanList=Неуспешно добавяне на запис на пощальона списък или база СПИП ErrorFailedToAddToMailmanList=Неуспешно добавяне на запис на пощальона списък или база СПИП
ErrorNewVaueCantMatchOldValue=Новата стойност не може да бъде равна на стария ErrorNewValueCantMatchOldValue=Новата стойност не може да бъде равна на стария
WarningMandatorySetupNotComplete=Задължителни параметри на настройката все още не са определени WarningMandatorySetupNotComplete=Задължителни параметри на настройката все още не са определени
WarningSafeModeOnCheckExecDir=Внимание, PHP опция <b>защитният режим</b> е включен, така че командата трябва да бъдат съхранени в директория, декларирани с параметър PHP <b>safe_mode_exec_dir.</b> WarningSafeModeOnCheckExecDir=Внимание, PHP опция <b>защитният режим</b> е включен, така че командата трябва да бъдат съхранени в директория, декларирани с параметър PHP <b>safe_mode_exec_dir.</b>
WarningAllowUrlFopenMustBeOn=Параметър <b>allow_url_fopen</b> трябва да бъде поставен <b>в</b> Filer <b>php.ini</b> за това, че този модул да работи напълно. Трябва да промените този файл ръчно. WarningAllowUrlFopenMustBeOn=Параметър <b>allow_url_fopen</b> трябва да бъде поставен <b>в</b> Filer <b>php.ini</b> за това, че този модул да работи напълно. Трябва да промените този файл ръчно.

View File

@ -116,7 +116,7 @@ ErrorFileMustBeADolibarrPackage=El fitxer %s ha de ser un paquet Dolibarr en for
ErrorFileRequired=Es requereix un fitxer de paquet Dolibarr en format zip ErrorFileRequired=Es requereix un fitxer de paquet Dolibarr en format zip
ErrorPhpCurlNotInstalled=L'extensió PHP CURL no es troba instal·lada, és indispensable per dialogar amb Paypal. ErrorPhpCurlNotInstalled=L'extensió PHP CURL no es troba instal·lada, és indispensable per dialogar amb Paypal.
ErrorFailedToAddToMailmanList=S'ha produït un error en intentar afegir un registre a la llista Mailman o base de dades SPIP ErrorFailedToAddToMailmanList=S'ha produït un error en intentar afegir un registre a la llista Mailman o base de dades SPIP
ErrorNewVaueCantMatchOldValue=El Nou valor no pot ser igual al antic ErrorNewValueCantMatchOldValue=El Nou valor no pot ser igual al antic
ErrorFailedToValidatePasswordReset=No s'ha pogut restablir la contrasenya. És possible que aquest enllaç ja s'hagi utilitzat (aquest enllaç només es pot utilitzar una vegada). Si no és el cas prova de reiniciar el procés de restabliment de contrasenya des del principi. ErrorFailedToValidatePasswordReset=No s'ha pogut restablir la contrasenya. És possible que aquest enllaç ja s'hagi utilitzat (aquest enllaç només es pot utilitzar una vegada). Si no és el cas prova de reiniciar el procés de restabliment de contrasenya des del principi.
# Warnings # Warnings

View File

@ -360,6 +360,13 @@ ExtrafieldSelect = Select list
LibraryToBuildPDF=Library used to build PDF LibraryToBuildPDF=Library used to build PDF
WarningUsingFPDF=Warning: Your <b>conf.php</b> contains directive <b>dolibarr_pdf_force_fpdf=1</b>. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.<br>To solve this and have a full support of PDF generation, please download <a href="http://www.tcpdf.org/" target="_blank">TCPDF library</a>, then comment or remove the line <b>$dolibarr_pdf_force_fpdf=1</b>, and add instead <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b> WarningUsingFPDF=Warning: Your <b>conf.php</b> contains directive <b>dolibarr_pdf_force_fpdf=1</b>. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.<br>To solve this and have a full support of PDF generation, please download <a href="http://www.tcpdf.org/" target="_blank">TCPDF library</a>, then comment or remove the line <b>$dolibarr_pdf_force_fpdf=1</b>, and add instead <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b>
LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:<br>1 : local tax apply on products and services without vat (vat is not applied on local tax)<br>2 : local tax apply on products and services before vat (vat is calculated on amount + localtax)<br>3 : local tax apply on products without vat (vat is not applied on local tax)<br>4 : local tax apply on products before vat (vat is calculated on amount + localtax)<br>5 : local tax apply on services without vat (vat is not applied on local tax)<br>6 : local tax apply on services before vat (vat is calculated on amount + localtax) LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:<br>1 : local tax apply on products and services without vat (vat is not applied on local tax)<br>2 : local tax apply on products and services before vat (vat is calculated on amount + localtax)<br>3 : local tax apply on products without vat (vat is not applied on local tax)<br>4 : local tax apply on products before vat (vat is calculated on amount + localtax)<br>5 : local tax apply on services without vat (vat is not applied on local tax)<br>6 : local tax apply on services before vat (vat is calculated on amount + localtax)
SMS=SMS
LinkToTestClickToDial=Enter a phone number to call to show a link to test the ClickToDial url for user <strong>%s</strong>
RefreshPhoneLink=Refresh link
LinkToTest=Clickable link generated for user <strong>%s</strong> (click phone number to test)
KeepEmptyToUseDefault=Keep empty to use default value
DefaultLink=Default link
ValueOverwrittenByUserSetup=Warning, this value may be overwritten by user specific setup (each user can set his own clicktodial url)
# Modules # Modules
Module0Name=Users & groups Module0Name=Users & groups

View File

@ -114,8 +114,9 @@ ErrNoZipEngine=No engine to unzip %s file in this PHP
ErrorFileMustBeADolibarrPackage=The file %s must be a Dolibarr zip package ErrorFileMustBeADolibarrPackage=The file %s must be a Dolibarr zip package
ErrorFileRequired=It takes a package Dolibarr file ErrorFileRequired=It takes a package Dolibarr file
ErrorPhpCurlNotInstalled=The PHP CURL is not installed, this is essential to talk with Paypal ErrorPhpCurlNotInstalled=The PHP CURL is not installed, this is essential to talk with Paypal
ErrorFailedToAddToMailmanList=Failed to add record to Mailman list or SPIP base ErrorFailedToAddToMailmanList=Failed to add record %s to Mailman list %s or SPIP base
ErrorNewVaueCantMatchOldValue=New value can't be equal to old one ErrorFailedToRemoveToMailmanList=Failed to remove record %s to Mailman list %s or SPIP base
ErrorNewValueCantMatchOldValue=New value can't be equal to old one
ErrorFailedToValidatePasswordReset=Failed to reinit password. May be the reinit was already done (this link can be used only one time). If not, try to restart the reinit process. ErrorFailedToValidatePasswordReset=Failed to reinit password. May be the reinit was already done (this link can be used only one time). If not, try to restart the reinit process.
# Warnings # Warnings
@ -132,3 +133,4 @@ WarningLockFileDoesNotExists=Warning, once setup is finished, you must disable i
WarningUntilDirRemoved=All security warnings (visible by admin users only) will remain active as long as the vulnerability is present (or that constant MAIN_REMOVE_INSTALL_WARNING is added in Setup->Other setup). WarningUntilDirRemoved=All security warnings (visible by admin users only) will remain active as long as the vulnerability is present (or that constant MAIN_REMOVE_INSTALL_WARNING is added in Setup->Other setup).
WarningCloseAlways=Warning, closing is done even if amount differs between source and target elements. Enable this feature with caution. WarningCloseAlways=Warning, closing is done even if amount differs between source and target elements. Enable this feature with caution.
WarningUsingThisBoxSlowDown=Warning, using this box slow down seriously all pages showing the box. WarningUsingThisBoxSlowDown=Warning, using this box slow down seriously all pages showing the box.
WarningClickToDialUserSetupNotComplete=Setup of ClickToDial information for your user are not complete (see tab ClickToDial onto your user card).

View File

@ -24,3 +24,5 @@ DeleteIntoSpip=Remove from SPIP
DeleteIntoSpipConfirmation=Are you sure you want to remove this member from SPIP? DeleteIntoSpipConfirmation=Are you sure you want to remove this member from SPIP?
DeleteIntoSpipError=Failed to suppress the user from SPIP DeleteIntoSpipError=Failed to suppress the user from SPIP
SPIPConnectionFailed=Failed to connect to SPIP SPIPConnectionFailed=Failed to connect to SPIP
SuccessToAddToMailmanList=Add of %s to mailman list %s or SPIP database done
SuccessToRemoveToMailmanList=Removal of %s from mailman list %s or SPIP database done

View File

@ -116,7 +116,7 @@ ErrorFileMustBeADolibarrPackage=El archivo %s debe ser un paquete Dolibarr en fo
ErrorFileRequired=Se requiere un archivo de paquete Dolibarr en formato zip ErrorFileRequired=Se requiere un archivo de paquete Dolibarr en formato zip
ErrorPhpCurlNotInstalled=La extensión PHP CURL no se encuentra instalada, es indispensable para dialogar con Paypal. ErrorPhpCurlNotInstalled=La extensión PHP CURL no se encuentra instalada, es indispensable para dialogar con Paypal.
ErrorFailedToAddToMailmanList=Ha ocurrido un error al intentar añadir un registro a la lista Mailman o base de datos SPIP ErrorFailedToAddToMailmanList=Ha ocurrido un error al intentar añadir un registro a la lista Mailman o base de datos SPIP
ErrorNewVaueCantMatchOldValue=El nuevo valor no puede ser igual al antiguo ErrorNewValueCantMatchOldValue=El nuevo valor no puede ser igual al antiguo
ErrorFailedToValidatePasswordReset=No se ha podido restablecer la contraseña. Es posible que este enlace ya se haya utilizado (este enlace sólo puede usarse una vez). Si no es el caso, trate de reiniciar el proceso de restablecimiento de contraseña desde el principio. ErrorFailedToValidatePasswordReset=No se ha podido restablecer la contraseña. Es posible que este enlace ya se haya utilizado (este enlace sólo puede usarse una vez). Si no es el caso, trate de reiniciar el proceso de restablecimiento de contraseña desde el principio.
# Warnings # Warnings

View File

@ -0,0 +1,3 @@
# Dolibarr language file - es_MX - banks
CHARSET=UTF-8
BankAccountDomiciliation=Tarjeta

View File

@ -21,3 +21,8 @@ CreditNoteDepositUse=La factura debe de estar validada para poder utilizar este
CreditNoteConvertedIntoDiscount=Esta nota de crédito se convirtió en %s CreditNoteConvertedIntoDiscount=Esta nota de crédito se convirtió en %s
TerreNumRefModelDesc1=Devuelve el número bajo el formato %syymm-nnnn para las facturas y %syymm-nnnn para las notas de crédito donde yy es el año, mm. el mes y nnnn un contador secuencial sin ruptura y sin permanencia a 0 TerreNumRefModelDesc1=Devuelve el número bajo el formato %syymm-nnnn para las facturas y %syymm-nnnn para las notas de crédito donde yy es el año, mm. el mes y nnnn un contador secuencial sin ruptura y sin permanencia a 0
AddCreditNote=Crear nota de crédito AddCreditNote=Crear nota de crédito
BillTo=Receptor
Residence=Tarjeta
IBANNumber=CLABE Interbancaria
BICNumber=Sucursal
PaymentByTransferOnThisBankAccount=Cuenta para depositos y transferencias

View File

@ -0,0 +1,3 @@
# Dolibarr language file - es_MX - categories
CHARSET=UTF-8
NotCategorized=Sin Categoría

View File

@ -1,3 +1,5 @@
# Dolibarr language file - es_MX - companies # Dolibarr language file - es_MX - companies
CHARSET=UTF-8 CHARSET=UTF-8
State=Estado
Town=Municipio
CompanyHasCreditNote=Este cliente tiene <b>%s %s</b> notas de crédito/anticipos disponibles CompanyHasCreditNote=Este cliente tiene <b>%s %s</b> notas de crédito/anticipos disponibles

View File

@ -0,0 +1,7 @@
# Dolibarr language file - es_MX - main
CHARSET=UTF-8
SeparatorDecimal=.
SeparatorThousand=,
AmountHT=Subtotal
TotalHT=Subtotal
TotalVAT=IVA

View File

@ -359,6 +359,13 @@ LibraryToBuildPDF=Bibliothèque utilisée pour la génération des PDF
WarningUsingFPDF=Attention: Votre fichier <b>conf.php</b> contient la directive <b>dolibarr_pdf_force_fpdf=1</b>. Cela signifie que vous utilisez la librairie FPDF pour générer vos fichiers PDF. Cette librairie est ancienne et ne couvre pas de nombreuses fonctionnalitée (Unicode, transparence des images, langues cyrillic, arabes ou asiatiques...), aussi vous pouvez rencontrez des problèmes durant la génération des PDF.<br>Pour résoudre cela et avoir un support complet de PDF, vous pouvez télécharger la <a href="http://www.tcpdf.org/" target="_blank">librairie TCPDF</a> puis commenter ou supprimer la ligne <b>$dolibarr_pdf_force_fpdf=1</b>, et ajouter à la place <b>$dolibarr_lib_TCPDF_PATH='chemin_vers_TCPDF'</b> WarningUsingFPDF=Attention: Votre fichier <b>conf.php</b> contient la directive <b>dolibarr_pdf_force_fpdf=1</b>. Cela signifie que vous utilisez la librairie FPDF pour générer vos fichiers PDF. Cette librairie est ancienne et ne couvre pas de nombreuses fonctionnalitée (Unicode, transparence des images, langues cyrillic, arabes ou asiatiques...), aussi vous pouvez rencontrez des problèmes durant la génération des PDF.<br>Pour résoudre cela et avoir un support complet de PDF, vous pouvez télécharger la <a href="http://www.tcpdf.org/" target="_blank">librairie TCPDF</a> puis commenter ou supprimer la ligne <b>$dolibarr_pdf_force_fpdf=1</b>, et ajouter à la place <b>$dolibarr_lib_TCPDF_PATH='chemin_vers_TCPDF'</b>
LocalTaxDesc=Certains pays appliquent 2 voir 3 taux sur chaque ligne de facture. Si c'est le cas, choisissez le type du deuxième et troisième taux et sa valeur. Les types possibles sont:<br>1 : taxe locale sur les produits et services hors tva (la tva n'est pas appliquée sur la taxe locale)<br>2 : taxe locale sur les produits et services avant tva (la tva est appliquée sur le montant + la taxe locale)<br>3 : taxe locale uniquement sur les produits hors tva (la tva n'est pas appliquée sur la taxe locale)<br>4 : taxe locale uniquement sur les produits avant tva (la tva est appliquée sur le montant + la taxe locale)<br>5 : taxe locale uniquement sur les services hors tva (la tva n'est pas appliquée sur la taxe locale)<br>6 : taxe locale uniquement sur les service avant tva (la tva est appliquée sur le montant + la taxe locale) LocalTaxDesc=Certains pays appliquent 2 voir 3 taux sur chaque ligne de facture. Si c'est le cas, choisissez le type du deuxième et troisième taux et sa valeur. Les types possibles sont:<br>1 : taxe locale sur les produits et services hors tva (la tva n'est pas appliquée sur la taxe locale)<br>2 : taxe locale sur les produits et services avant tva (la tva est appliquée sur le montant + la taxe locale)<br>3 : taxe locale uniquement sur les produits hors tva (la tva n'est pas appliquée sur la taxe locale)<br>4 : taxe locale uniquement sur les produits avant tva (la tva est appliquée sur le montant + la taxe locale)<br>5 : taxe locale uniquement sur les services hors tva (la tva n'est pas appliquée sur la taxe locale)<br>6 : taxe locale uniquement sur les service avant tva (la tva est appliquée sur le montant + la taxe locale)
SuhosinSessionEncrypt=Stockage des sessions encryptés par Suhosin SuhosinSessionEncrypt=Stockage des sessions encryptés par Suhosin
SMS=SMS
LinkToTestClickToDial=Entrez un numéro de téléphone à appeler pour tester le lien d'appel ClickToDial pour l'utilisateur <strong>%s</strong>
RefreshPhoneLink=Rafraichir lien
LinkToTest=Lien clicable généré pour l'utilisateur <strong>%s</strong> (cliquer le numéro pour tester)
KeepEmptyToUseDefault=Laisser ce champ vide pour utiliser la valeure par défaut
DefaultLink=Lien par défaut
ValueOverwrittenByUserSetup=Attention, cette valeur peut être écrasée par une valeur spécifique à la configuration de l'utilisateur (chaque utilisateur pouvant avoir sa propre url clicktodial)
# Modules= undefined # Modules= undefined
Module0Name= Utilisateurs & groupes Module0Name= Utilisateurs & groupes

View File

@ -115,8 +115,9 @@ ErrNoZipEngine=Pas de moteur pour décompresser le fichier %s dans ce PHP
ErrorFileMustBeADolibarrPackage=Le fichier doit être un package Dolibarr ErrorFileMustBeADolibarrPackage=Le fichier doit être un package Dolibarr
ErrorFileRequired=Il faut un fichier de package Dolibarr ErrorFileRequired=Il faut un fichier de package Dolibarr
ErrorPhpCurlNotInstalled=L'extension PHP CURL n'est pas installée, ceci est indispensable pour dialoguer avec Paypal. ErrorPhpCurlNotInstalled=L'extension PHP CURL n'est pas installée, ceci est indispensable pour dialoguer avec Paypal.
ErrorFailedToAddToMailmanList=Echec de l'ajout à une liste Mailman ou base SPIP ErrorFailedToAddToMailmanList=Echec de l'ajout de %s à la liste Mailman %s ou base SPIP
ErrorNewVaueCantMatchOldValue=La nouvelle valeur ne peut être égale à l'ancienne ErrorFailedToRemoveToMailmanList=Echec de la suppression de %s de la liste Mailman %s ou base SPIP
ErrorNewValueCantMatchOldValue=La nouvelle valeur ne peut être égale à l'ancienne
ErrorFailedToValidatePasswordReset=Echec de la réinitialisation du mot de passe. Il est possible que ce lien ait déjà été utilisé (l'utilisation de ce lien ne fonctionne qu'une fois). Si ce n'est pas le cas, essayer de recommencer le processus de réinit de mot de passe depuis le début. ErrorFailedToValidatePasswordReset=Echec de la réinitialisation du mot de passe. Il est possible que ce lien ait déjà été utilisé (l'utilisation de ce lien ne fonctionne qu'une fois). Si ce n'est pas le cas, essayer de recommencer le processus de réinit de mot de passe depuis le début.
# Warnings # Warnings
@ -133,3 +134,4 @@ WarningLockFileDoesNotExists=Attention, une fois l'installation terminée, les o
WarningUntilDirRemoved=Les alertes de sécurité sont visibles par les administrateurs uniquement et resteront actives tant que la vulnérabilité sera avérée (ou que la constante MAIN_REMOVE_INSTALL_WARNING aura été définie dans Configuration->Divers) WarningUntilDirRemoved=Les alertes de sécurité sont visibles par les administrateurs uniquement et resteront actives tant que la vulnérabilité sera avérée (ou que la constante MAIN_REMOVE_INSTALL_WARNING aura été définie dans Configuration->Divers)
WarningCloseAlways=Attention, la fermeture se fait même lorsque le montant diffère. N'activez cette fonctionnalité qu'en connaissance de cause. WarningCloseAlways=Attention, la fermeture se fait même lorsque le montant diffère. N'activez cette fonctionnalité qu'en connaissance de cause.
WarningUsingThisBoxSlowDown=Attention, l'utilisation de cette boite provoque de sérieux ralentissement des pages affichant cette boite. WarningUsingThisBoxSlowDown=Attention, l'utilisation de cette boite provoque de sérieux ralentissement des pages affichant cette boite.
WarningClickToDialUserSetupNotComplete=La configuration ClickToDial pour votre compte utilisateur n'est pas complète (voir l'onglet ClickToDial sur votre fiche utilisateur)

View File

@ -23,3 +23,6 @@ DeleteIntoSpip=Supprimer de spip
DeleteIntoSpipConfirmation=Êtes-vous sur de vouloir effacer cet adhérent de SPIP? DeleteIntoSpipConfirmation=Êtes-vous sur de vouloir effacer cet adhérent de SPIP?
DeleteIntoSpipError=Échec de la suppression de l'utilisateur de SPIP DeleteIntoSpipError=Échec de la suppression de l'utilisateur de SPIP
SPIPConnectionFailed=Échec de connexion à SPIP SPIPConnectionFailed=Échec de connexion à SPIP
SuccessToAddToMailmanList=Ajout de %s à la liste Mailman %s ou base SPIP réalisé
SuccessToRemoveToMailmanList=Suppression de %s de la liste Mailman %s ou base SPIP réalisé

View File

@ -1,5 +1,5 @@
# Dolibarr language file - pt_PT - admin # Dolibarr language file - pt_PT - admin
CHARSET = UTF-8 CHARSET = UTF-8
AccountCodeManager = Módulo de geração dos códigos contabilisticos (Clientes/Fornecedores) AccountCodeManager = Módulo de geração dos códigos contabilisticos (Clientes/Fornecedores)
ActivateFCKeditor = Activar FCKeditor para : ActivateFCKeditor = Activar FCKeditor para :
ActivateOn = Activar sobre ActivateOn = Activar sobre

View File

@ -1,5 +1,5 @@
/* /*
* Language code: zh_CN * Language code: zh_CN (simplified)
* Automatic generated via autotranslator.php tool * Automatic generated via autotranslator.php tool
* Generation date 2010-06-09 00:39:24 * Generation date 2010-06-09 00:39:24
*/ */

View File

@ -1,13 +1,14 @@
/* /*
* Language code: zh_TW * Language code: zh_TW (traditionnal)
* Generation date 2012-09-04 16:02:00 * Generation date 2012-09-04 16:02:00
*/ */
// Reference language: en_US // Reference language: en_US
CHARSET=UTF-8 CHARSET=UTF-8
DIRECTION=ltr DIRECTION=ltr
#FONTFORPDF=chinese # msungstdlight or cid0ct are for traditionnal chinese (traditionnal does not render with ubuntu pdf reader)
FONTFORPDF=stsongstdlight # stsongstdlight or cid0cs are for simplified chinese
FONTFORPDF=msungstdlight
#FONTSIZEFORPDF=9 #FONTSIZEFORPDF=9
SeparatorDecimal=. SeparatorDecimal=.
SeparatorThousand=None SeparatorThousand=None

View File

@ -40,6 +40,11 @@ class MailmanSpip
var $db; var $db;
var $error; var $error;
var $mladded_ok;
var $mladded_ko;
var $mlremoved_ok;
var $mlremoved_ko;
/** /**
* Constructor * Constructor
@ -299,6 +304,9 @@ class MailmanSpip
dol_syslog(get_class($this)."::add_to_mailman"); dol_syslog(get_class($this)."::add_to_mailman");
$this->mladded_ok=array();
$this->mladded_ko=array();
if (! function_exists("curl_init")) if (! function_exists("curl_init"))
{ {
$langs->load("errors"); $langs->load("errors");
@ -335,13 +343,15 @@ class MailmanSpip
if ($result === false) if ($result === false)
{ {
$this->mladded_ko[$list]=$object->email;
return -2; return -2;
} }
else $this->mladded_ok[$list]=$object->email;
} }
return count($lists); return count($lists);
} }
else else
{ {
$this->error="ADHERENT_MAILMAN_URL not defined"; $this->error="ADHERENT_MAILMAN_URL not defined";
return -1; return -1;
} }
@ -359,6 +369,18 @@ class MailmanSpip
{ {
global $conf,$langs,$user; global $conf,$langs,$user;
dol_syslog(get_class($this)."::del_to_mailman");
$this->mlremoved_ok=array();
$this->mlremoved_ko=array();
if (! function_exists("curl_init"))
{
$langs->load("errors");
$this->error=$langs->trans("ErrorFunctionNotAvailableInPHP","curl_init");
return -1;
}
if (! empty($conf->global->ADHERENT_MAILMAN_UNSUB_URL)) if (! empty($conf->global->ADHERENT_MAILMAN_UNSUB_URL))
{ {
if ($listes=='' && ! empty($conf->global->ADHERENT_MAILMAN_LISTS)) if ($listes=='' && ! empty($conf->global->ADHERENT_MAILMAN_LISTS))
@ -388,8 +410,10 @@ class MailmanSpip
if ($result === false) if ($result === false)
{ {
$this->mlremoved_ko[$list]=$object->email;
return -2; return -2;
} }
else $this->mlremoved_ok[$list]=$object->email;
} }
return count($lists); return count($lists);
} }

View File

@ -1516,6 +1516,19 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
print "<!-- End Bookmarks -->\n"; print "<!-- End Bookmarks -->\n";
} }
//Dolibarr version
$doliurl='http://www.dolibarr.org';
$appli='Dolibarr';
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) {
$appli=$conf->global->MAIN_APPLICATION_TITLE; $doliurl='';
}
$appli.=" ".DOL_VERSION;
print '<div id="blockvmenuhelp" class="blockvmenuhelp">';
if ($doliurl) print '<a class="help" target="_blank" href="'.$doliurl.'">';
print $appli;
if ($doliurlx) print '</a>';
print '</div>';
// Link to Dolibarr wiki pages // Link to Dolibarr wiki pages
if ($helppagename && empty($conf->global->MAIN_HELP_DISABLELINK)) if ($helppagename && empty($conf->global->MAIN_HELP_DISABLELINK))
{ {
@ -1566,18 +1579,6 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
} }
print "\n"; print "\n";
//Dolibarr version
$doliurl='http://www.dolibarr.org';
$appli='Dolibarr';
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) { $appli=$conf->global->MAIN_APPLICATION_TITLE; $doliurl=''; }
$appli.=" ".DOL_VERSION;
print '<div id="blockvmenuhelp" class="blockvmenuhelp">';
if ($doliurl) print '<a class="help" target="_blank" href="'.$doliurl.'">';
print $appli;
if ($doliurlx) print '</a>';
print '</div>';
print "</div>\n"; print "</div>\n";
print "<!-- End left menu -->\n"; print "<!-- End left menu -->\n";

View File

@ -54,7 +54,7 @@ if ($action == 'convert')
if ($oldvatrate == $newvatrate) if ($oldvatrate == $newvatrate)
{ {
$langs->load("errors"); $langs->load("errors");
setEventMessage($langs->trans("ErrorNewVaueCantMatchOldValue"),'errors'); setEventMessage($langs->trans("ErrorNewValueCantMatchOldValue"),'errors');
$error++; $error++;
} }

View File

@ -259,7 +259,7 @@ else
} }
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -164,7 +164,7 @@ if ($resql)
} }
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -249,7 +249,7 @@ else
} }
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -596,10 +596,6 @@ div.mainmenu.companies {
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/members.png',1) ?>); background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/members.png',1) ?>);
} }
div.mainmenu.contacts {
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/stethoscope.png',1) ?>);
}
div.mainmenu.commercial { div.mainmenu.commercial {
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/commercial.png',1) ?>); background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/commercial.png',1) ?>);
} }

View File

@ -81,6 +81,11 @@ class User extends CommonObject
var $phenix_pass; var $phenix_pass;
var $phenix_pass_crypted; var $phenix_pass_crypted;
var $clicktodial_url;
var $clicktodial_login;
var $clicktodial_password;
var $clicktodial_poste;
var $datelastlogin; var $datelastlogin;
var $datepreviouslogin; var $datepreviouslogin;
var $statut; var $statut;
@ -1545,7 +1550,7 @@ class User extends CommonObject
*/ */
function fetch_clicktodial() function fetch_clicktodial()
{ {
$sql = "SELECT login, pass, poste "; $sql = "SELECT url, login, pass, poste ";
$sql.= " FROM ".MAIN_DB_PREFIX."user_clicktodial as u"; $sql.= " FROM ".MAIN_DB_PREFIX."user_clicktodial as u";
$sql.= " WHERE u.fk_user = ".$this->id; $sql.= " WHERE u.fk_user = ".$this->id;
@ -1556,6 +1561,7 @@ class User extends CommonObject
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->clicktodial_url = $obj->url;
$this->clicktodial_login = $obj->login; $this->clicktodial_login = $obj->login;
$this->clicktodial_password = $obj->pass; $this->clicktodial_password = $obj->pass;
$this->clicktodial_poste = $obj->poste; $this->clicktodial_poste = $obj->poste;
@ -1585,26 +1591,28 @@ class User extends CommonObject
$sql = "DELETE FROM ".MAIN_DB_PREFIX."user_clicktodial"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_clicktodial";
$sql .= " WHERE fk_user = ".$this->id; $sql .= " WHERE fk_user = ".$this->id;
dol_syslog(get_class($this).'::update_clicktodial sql='.$sql);
$result = $this->db->query($sql); $result = $this->db->query($sql);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."user_clicktodial"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_clicktodial";
$sql .= " (fk_user,login,pass,poste)"; $sql .= " (fk_user,url,login,pass,poste)";
$sql .= " VALUES (".$this->id; $sql .= " VALUES (".$this->id;
$sql .= ", '". $this->clicktodial_login ."'"; $sql .= ", '". $this->db->escape($this->clicktodial_url) ."'";
$sql .= ", '". $this->clicktodial_password ."'"; $sql .= ", '". $this->db->escape($this->clicktodial_login) ."'";
$sql .= ", '". $this->clicktodial_poste."')"; $sql .= ", '". $this->db->escape($this->clicktodial_password) ."'";
$sql .= ", '". $this->db->escape($this->clicktodial_poste) ."')";
dol_syslog(get_class($this).'::update_clicktodial sql='.$sql);
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
{ {
$this->db->commit(); $this->db->commit();
return 0; return 1;
} }
else else
{ {
$this->db->rollback(); $this->db->rollback();
$this->error=$this->db->error(); $this->error=$this->db->lasterror();
return -1; return -1;
} }
} }
@ -1961,6 +1969,8 @@ class User extends CommonObject
$this->admin=0; $this->admin=0;
$this->login='dolibspec'; $this->login='dolibspec';
$this->pass='dolibspec'; $this->pass='dolibspec';
//$this->pass_indatabase='dolibspec'; Set after a fetch
//$this->pass_indatabase_crypted='e80ca5a88c892b0aaaf7e154853bccab'; Set after a fetch
$this->datec=time(); $this->datec=time();
$this->datem=time(); $this->datem=time();
$this->webcal_login='dolibspec'; $this->webcal_login='dolibspec';
@ -1969,7 +1979,9 @@ class User extends CommonObject
$this->datepreviouslogin=time(); $this->datepreviouslogin=time();
$this->statut=1; $this->statut=1;
$this->societe_id = 1; //$this->societe_id = 1; For external users
//$this->contact_id = 1; For external users
$this->entity = 1;
} }
/** /**

View File

@ -51,11 +51,13 @@ if ($action == 'update' && ! $_POST['cancel'])
$edituser = new User($db); $edituser = new User($db);
$edituser->fetch($id); $edituser->fetch($id);
$edituser->clicktodial_login = $_POST["login"]; $edituser->clicktodial_url = GETPOST("url");
$edituser->clicktodial_password = $_POST["password"]; $edituser->clicktodial_login = GETPOST("login");
$edituser->clicktodial_poste = $_POST["poste"]; $edituser->clicktodial_password = GETPOST("password");
$edituser->clicktodial_poste = GETPOST("poste");
$result=$edituser->update_clicktodial(); $result=$edituser->update_clicktodial();
if ($result < 0) setEventMessage($edituser->error,'errors');
} }
@ -110,7 +112,7 @@ if ($id > 0)
print "</table>\n"; print "</table>\n";
print "<br>\n"; print "<br>\n";
// Edit mode
if ($action == 'edit') if ($action == 'edit')
{ {
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$fuser->id.'" method="post">'; print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$fuser->id.'" method="post">';
@ -122,13 +124,17 @@ if ($id > 0)
{ {
print '<tr><td width="25%" valign="top">ClickToDial URL</td>'; print '<tr><td width="25%" valign="top">ClickToDial URL</td>';
print '<td class="valeur">'; print '<td class="valeur">';
if (empty($conf->global->CLICKTODIAL_URL)) print '<input name="url" value="'.(! empty($fuser->clicktodial_url)?$fuser->clicktodial_url:'').'" size="92">';
if (empty($conf->global->CLICKTODIAL_URL) && empty($fuser->clicktodial_url))
{ {
$langs->load("errors"); $langs->load("errors");
print '<font class="error">'.$langs->trans("ErrorModuleSetupNotComplete").'</font>'; print '<font class="error">'.$langs->trans("ErrorModuleSetupNotComplete").'</font>';
} }
else print $form->textwithpicto($conf->global->CLICKTODIAL_URL,$langs->trans("ClickToDialUrlDesc")); else
print '</td>'; {
print ' &nbsp; &nbsp; '.$form->textwithpicto($langs->trans("KeepEmptyToUseDefault").': '.$conf->global->CLICKTODIAL_URL,$langs->trans("ClickToDialUrlDesc"));
}
print '</td>';
print '</tr>'; print '</tr>';
} }
@ -147,14 +153,16 @@ if ($id > 0)
print '<input name="poste" value="'.(! empty($fuser->clicktodial_poste)?$fuser->clicktodial_poste:'').'"></td>'; print '<input name="poste" value="'.(! empty($fuser->clicktodial_poste)?$fuser->clicktodial_poste:'').'"></td>';
print "</tr>\n"; print "</tr>\n";
print '<tr><td colspan="2" align="center"><input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '</table>';
print ' &nbsp; &nbsp; ';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</td></tr>';
print '</table></form>'; print '<br><center><input class="button" type="submit" value="'.$langs->trans("Save").'">';
print ' &nbsp; &nbsp; ';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</center>';
print '</form>';
} }
else else // View mode
{ {
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -163,12 +171,17 @@ if ($id > 0)
{ {
print "<tr>".'<td width="25%" valign="top">ClickToDial URL</td>'; print "<tr>".'<td width="25%" valign="top">ClickToDial URL</td>';
print '<td class="valeur">'; print '<td class="valeur">';
if (empty($conf->global->CLICKTODIAL_URL)) $url=$conf->global->CLICKTODIAL_URL;
if (! empty($fuser->clicktodial_url)) $url=$fuser->clicktodial_url;
if (empty($url))
{ {
$langs->load("errors"); $langs->load("errors");
print '<font class="error">'.$langs->trans("ErrorModuleSetupNotComplete").'</font>'; print '<font class="error">'.$langs->trans("ErrorModuleSetupNotComplete").'</font>';
} }
else print $form->textwithpicto($conf->global->CLICKTODIAL_URL,$langs->trans("ClickToDialUrlDesc")); else
{
print $form->textwithpicto((empty($fuser->clicktodial_url)?$langs->trans("DefaultLink").': ':'').$url,$langs->trans("ClickToDialUrlDesc"));
}
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }

View File

@ -1069,7 +1069,7 @@ else
// Firstname // Firstname
print '<tr><td valign="top">'.$langs->trans("Firstname").'</td>'; print '<tr><td valign="top">'.$langs->trans("Firstname").'</td>';
print '<td>'.$object->Firstname.'</td>'; print '<td>'.$object->firstname.'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
// Position/Job // Position/Job
@ -1560,12 +1560,12 @@ else
print '<td>'; print '<td>';
if ($caneditfield && !$object->ldap_sid) if ($caneditfield && !$object->ldap_sid)
{ {
print '<input size="30" type="text" class="flat" name="Firstname" value="'.$object->Firstname.'">'; print '<input size="30" type="text" class="flat" name="firstname" value="'.$object->firstname.'">';
} }
else else
{ {
print '<input type="hidden" name="Firstname" value="'.$object->Firstname.'">'; print '<input type="hidden" name="firstname" value="'.$object->firstname.'">';
print $object->Firstname; print $object->firstname;
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -254,7 +254,7 @@ if ($canreadperms)
} }
//print '</td></tr></table>'; //print '</td></tr></table>';
print '<div></div></div>'; print '</div></div></div>';
llxFooter(); llxFooter();

View File

@ -33,12 +33,12 @@ if (! defined('EVEN_IF_ONLY_LOGIN_ALLOWED')) define('EVEN_IF_ONLY_LOGIN_ALLOWED
require_once '../main.inc.php'; require_once '../main.inc.php';
// This can happen only with a bookmark or forged url call. // This can happen only with a bookmark or forged url call.
if (!empty($_SESSION["dol_authmode"]) && ($_SESSION["dol_authmode"] == 'forceuser' if (!empty($_SESSION["dol_authmode"]) && ($_SESSION["dol_authmode"] == 'forceuser' || $_SESSION["dol_authmode"] == 'http'))
|| $_SESSION["dol_authmode"] == 'http'))
{ {
die("Disconnection does not work when connection was made in mode ".$_SESSION["dol_authmode"]); die("Disconnection does not work when connection was made in mode ".$_SESSION["dol_authmode"]);
} }
// Appel des triggers // Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db); $interface=new Interfaces($db);
@ -53,13 +53,16 @@ $urlfrom=empty($_SESSION["urlfrom"])?'':$_SESSION["urlfrom"];
// TODO external module // TODO external module
if (! empty($conf->phenix->enabled) && ! empty($conf->phenix->cookie)) if (! empty($conf->phenix->enabled) && ! empty($conf->phenix->cookie))
{ {
// Destroy cookie
setcookie($conf->phenix->cookie, '', 1, "/"); setcookie($conf->phenix->cookie, '', 1, "/");
} }
// Destroy object of session // Define url to go
unset($_SESSION['dol_login']); $url=DOL_URL_ROOT."/index.php"; // By default go to login page
unset($_SESSION['dol_entity']); if ($urlfrom) $url=DOL_URL_ROOT.$urlfrom;
if (! empty($conf->global->MAIN_LOGOUT_GOTO_URL)) $url=$conf->global->MAIN_LOGOUT_GOTO_URL;
if (! empty($_SESSION['dol_hide_topmenu'])) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_topmenu=1';
if (! empty($_SESSION['dol_hide_leftmenu'])) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_leftmenu=1';
// Destroy session // Destroy session
$prefix=dol_getprefix(); $prefix=dol_getprefix();
@ -70,10 +73,9 @@ session_name($sessionname);
session_destroy(); session_destroy();
dol_syslog("End of session ".$sessionname); dol_syslog("End of session ".$sessionname);
// Define url to go // TODO Not sure this is required
$url=DOL_URL_ROOT."/index.php"; // By default go to login page unset($_SESSION['dol_login']);
if ($urlfrom) $url=DOL_URL_ROOT.$urlfrom; unset($_SESSION['dol_entity']);
if (! empty($conf->global->MAIN_LOGOUT_GOTO_URL)) $url=$conf->global->MAIN_LOGOUT_GOTO_URL;
//print 'url='.$url;exit; //print 'url='.$url;exit;
header("Location: ".$url); header("Location: ".$url);

18
scripts/clicktodial/linphone.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
#---------------------------------------------------------
# Script to launch LinPhone softphone.
# This script can be used to setup a ClickToDial system
# when using LinPhone soft phone.
# More information on http://wiki.dolibarr.org/index.php/Module_ClickToDial_En
#---------------------------------------------------------
# Note: Adding handler into gconf-tools seems to do nothing
# gconftool-2 -t string -s /desktop/gnome/url-handlers/sip/command "linphone-3 -c %s"
# gconftool-2 -s /desktop/gnome/url-handlers/sip/needs_terminal false -t bool
# gconftool-2 -t bool -s /desktop/gnome/url-handlers/sip/enabled true
echo Launch Linphone $1 $2
param=`echo $1 | sed -s 's/^sip:[\/]*//' `
/usr/bin/linphone-3 -c $param &

View File

@ -176,12 +176,19 @@ class UserTest extends PHPUnit_Framework_TestCase
$langs=$this->savlangs; $langs=$this->savlangs;
$db=$this->savdb; $db=$this->savdb;
$localobject->note='New note after update'; $this->changeProperties($localobject);
$result=$localobject->update($user); $result=$localobject->update($user);
print __METHOD__." id=".$localobject->id." result=".$result."\n"; print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
return $localobject;
// Test everything are still same than specimen
$newlocalobject=new User($this->savdb);
$newlocalobject->initAsSpecimen();
$this->changeProperties($newlocalobject);
$this->assertEquals($this->objCompare($localobject,$newlocalobject,true,array('id','ref','pass_indatabase','pass_indatabase_crypted','date_creation','datelastlogin','datepreviouslogin')), array()); // Actual, Expected
return $localobject;
} }
/** /**
@ -204,6 +211,7 @@ class UserTest extends PHPUnit_Framework_TestCase
print __METHOD__." id=".$localobject->id." result=".$result."\n"; print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
return $localobject; return $localobject;
} }
@ -260,5 +268,54 @@ class UserTest extends PHPUnit_Framework_TestCase
return $result; return $result;
} }
/**
* Edit an object to test updates
*
* @param mixed &$localobject Object Facture
* @return void
*/
public function changeProperties(&$localobject)
{
$localobject->note='New note after update';
}
/**
* Compare all public properties values of 2 objects
*
* @param Object $oA Object operand 1
* @param Object $oB Object operand 2
* @param boolean $ignoretype False will not report diff if type of value differs
* @param array $fieldstoignorearray Array of fields to ignore in diff
* @return array Array with differences
*/
public function objCompare($oA,$oB,$ignoretype=true,$fieldstoignorearray=array('id'))
{
$retAr=array();
if (get_class($oA) !== get_class($oB))
{
$retAr[]="Supplied objects are not of same class.";
}
else
{
$oVarsA=get_object_vars($oA);
$oVarsB=get_object_vars($oB);
$aKeys=array_keys($oVarsA);
foreach($aKeys as $sKey)
{
if (in_array($sKey,$fieldstoignorearray)) continue;
if (! $ignoretype && $oVarsA[$sKey] !== $oVarsB[$sKey])
{
$retAr[]=$sKey.' : '.(is_object($oVarsA[$sKey])?get_class($oVarsA[$sKey]):$oVarsA[$sKey]).' <> '.(is_object($oVarsB[$sKey])?get_class($oVarsB[$sKey]):$oVarsB[$sKey]);
}
if ($ignoretype && $oVarsA[$sKey] != $oVarsB[$sKey])
{
$retAr[]=$sKey.' : '.(is_object($oVarsA[$sKey])?get_class($oVarsA[$sKey]):$oVarsA[$sKey]).' <> '.(is_object($oVarsB[$sKey])?get_class($oVarsB[$sKey]):$oVarsB[$sKey]);
}
}
}
return $retAr;
}
} }
?> ?>