Merge remote-tracking branch 'Upstream/develop' into develop-hrm3

This commit is contained in:
aspangaro 2015-11-13 07:52:44 +01:00
commit 0f75d76296
46 changed files with 474 additions and 244 deletions

View File

@ -97,7 +97,7 @@ When submitting a pull request, use same rule as [Commits](#commits) for the mes
If your pull request only contains one commit, GitHub will be smart enough to fill it for you. If your pull request only contains one commit, GitHub will be smart enough to fill it for you.
Otherwise, please be a bit verbose about what you're providing. Otherwise, please be a bit verbose about what you're providing.
You Pull Request must pass the Continuous Integration checks. Your Pull Request must pass the Continuous Integration checks.
Also, if you want to include a new external library (into htdocs/includes directory), please ask before to the project Also, if you want to include a new external library (into htdocs/includes directory), please ask before to the project
leader to see if such a library can be accepted. leader to see if such a library can be accepted.

View File

@ -0,0 +1,48 @@
Content-Type: multipart/mixed; boundary="===============4543832834454763172=="
Date: Thu, 12 Nov 2015 17:58:00 -0000
From: Administrator <admin@yourcompany.example.com>
MIME-Version: 1.0
Message-ID: 5nLkUQEIn50FnlwxWDkh59NfLof1ode0uC5cZEgm9Y4=@mailhog.example
Message-Id: <1447351080.369951963424683.576889035053436-dolibarr-7-thirdparty@PCHOME-LD>
Received: from pchome-ld by mailhog.example (Go-MailHog)
id 5nLkUQEIn50FnlwxWDkh59NfLof1ode0uC5cZEgm9Y4=@mailhog.example; Thu, 12 Nov 2015 18:58:00 +0100
Reply-To: Administrator <admin@yourcompany.example.com>
Return-Path: <admin@yourcompany.example.com>
Subject: A test email from thirdparty card
To: Thirdparty company <thirdpartycompany@yourcompany.example.com>
--===============4543832834454763172==
Content-Type: multipart/alternative;
boundary="===============8764907306434163361=="
MIME-Version: 1.0
--===============8764907306434163361==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
dGVzdDIKCi0tCkFkbWluaXN0cmF0b3IKClNlbnQgYnkgWW91ckNvbXBhbnkgWzFdIHVzaW5nIE9k
b28gWzJdCgosICBhY2Nlc3MgZGlyZWN0bHkgdG8gUGFydG5lciBBZ3JvbGFpdCBbM10KCgpbMV0g
aHR0cDovL3d3dy5leGFtcGxlLmNvbQpbMl0gaHR0cHM6Ly93d3cub2Rvby5jb20vClszXSBodHRw
Oi8vbG9jYWxob3N0OjgxNjkvd2ViL3NpZ251cD9yZWRpcmVjdD0lMkZ3ZWIlMjNhY3Rpb24lM0Rt
YWlsLmFjdGlvbl9tYWlsX3JlZGlyZWN0JTI2bW9kZWwlM0RyZXMucGFydG5lciUyNmlkJTNENyZ0
b2tlbj1nM0s0QWU1T0Q5a3UxaEVubVZUQiZkYj1vZG9vX3Y4Cg==
--===============8764907306434163361==
Content-Type: text/html; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
PHA+dGVzdDI8L3A+Cgo8c3Bhbj4tLTxicj4KQWRtaW5pc3RyYXRvcjwvc3Bhbj4KCjxiciAvPjxz
bWFsbD5TZW50IGJ5IDxhIHN0eWxlPSdjb2xvcjppbmhlcml0JyBocmVmPSdodHRwOi8vd3d3LmV4
YW1wbGUuY29tJz5Zb3VyQ29tcGFueTwvYT4gdXNpbmcgPGEgc3R5bGU9J2NvbG9yOmluaGVyaXQn
IGhyZWY9J2h0dHBzOi8vd3d3Lm9kb28uY29tLyc+T2RvbzwvYT48L3NtYWxsPgoKCiwgPHNwYW4g
Y2xhc3M9J29lX21haWxfZm9vdGVyX2FjY2Vzcyc+PHNtYWxsPmFjY2VzcyBkaXJlY3RseSB0byA8
YSBzdHlsZT0nY29sb3I6aW5oZXJpdCcgaHJlZj0naHR0cDovL2xvY2FsaG9zdDo4MTY5L3dlYi9z
aWdudXA/cmVkaXJlY3Q9JTJGd2ViJTIzYWN0aW9uJTNEbWFpbC5hY3Rpb25fbWFpbF9yZWRpcmVj
dCUyNm1vZGVsJTNEcmVzLnBhcnRuZXIlMjZpZCUzRDcmdG9rZW49ZzNLNEFlNU9EOWt1MWhFbm1W
VEImZGI9b2Rvb192OCc+UGFydG5lciBBZ3JvbGFpdDwvYT48L3NtYWxsPjwvc3Bhbj4K
--===============8764907306434163361==--
--===============4543832834454763172==--

View File

@ -112,7 +112,7 @@ if (empty($reshook))
if (empty($object->ref)) if (empty($object->ref))
{ {
$error++; $error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors'); setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), null, 'errors');
} }
if (! $error) if (! $error)
@ -152,7 +152,7 @@ if (empty($reshook))
if (empty($object->ref)) if (empty($object->ref))
{ {
$error++; $error++;
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors'); setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), null, 'errors');
} }
if (! $error) if (! $error)
@ -189,8 +189,8 @@ if (empty($reshook))
} }
else else
{ {
if (! empty($object->errors)) setEventMessages(null,$object->errors,'errors'); if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors');
else setEventMessages($object->error,null,'errors'); else setEventMessages($object->error, null, 'errors');
} }
} }
} }

View File

@ -152,6 +152,7 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
$subject = $_POST['subject']; $subject = $_POST['subject'];
$body = $_POST['message']; $body = $_POST['message'];
$deliveryreceipt= $_POST["deliveryreceipt"]; $deliveryreceipt= $_POST["deliveryreceipt"];
$trackid = GETPOST('trackid');
//Check if we have to decode HTML //Check if we have to decode HTML
if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($body, ENT_COMPAT | ENT_HTML401))) { if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($body, ENT_COMPAT | ENT_HTML401))) {
@ -202,7 +203,9 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
$sendtoccc, $sendtoccc,
$deliveryreceipt, $deliveryreceipt,
$msgishtml, $msgishtml,
$errors_to $errors_to,
'',
$trackid
); );
$result=$mailfile->sendfile(); $result=$mailfile->sendfile();
@ -693,6 +696,7 @@ else
$formmail = new FormMail($db); $formmail = new FormMail($db);
$formmail->fromname = (isset($_POST['fromname'])?$_POST['fromname']:$conf->global->MAIN_MAIL_EMAIL_FROM); $formmail->fromname = (isset($_POST['fromname'])?$_POST['fromname']:$conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->frommail = (isset($_POST['frommail'])?$_POST['frommail']:$conf->global->MAIN_MAIL_EMAIL_FROM); $formmail->frommail = (isset($_POST['frommail'])?$_POST['frommail']:$conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->trackid='test';
$formmail->withfromreadonly=0; $formmail->withfromreadonly=0;
$formmail->withsubstit=0; $formmail->withsubstit=0;
$formmail->withfrom=1; $formmail->withfrom=1;

View File

@ -37,6 +37,7 @@ $langs->load("admin");
$mode=GETPOST('mode', 'alpha')?GETPOST('mode', 'alpha'):(isset($_SESSION['mode'])?$_SESSION['mode']:0); $mode=GETPOST('mode', 'alpha')?GETPOST('mode', 'alpha'):(isset($_SESSION['mode'])?$_SESSION['mode']:0);
$action=GETPOST('action','alpha'); $action=GETPOST('action','alpha');
$value=GETPOST('value', 'alpha'); $value=GETPOST('value', 'alpha');
$page_y=GETPOST('page_y','int');
if (! $user->admin) if (! $user->admin)
accessforbidden(); accessforbidden();
@ -67,7 +68,7 @@ if ($action == 'set' && $user->admin)
{ {
$result=activateModule($value); $result=activateModule($value);
if ($result) setEventMessages($result, null, 'errors'); if ($result) setEventMessages($result, null, 'errors');
header("Location: modules.php?mode=".$mode); header("Location: modules.php?mode=".$mode.($page_y?'&page_y='.$page_y:''));
exit; exit;
} }
@ -75,7 +76,7 @@ if ($action == 'reset' && $user->admin)
{ {
$result=unActivateModule($value); $result=unActivateModule($value);
if ($result) setEventMessages($result, null, 'errors'); if ($result) setEventMessages($result, null, 'errors');
header("Location: modules.php?mode=".$mode); header("Location: modules.php?mode=".$mode.($page_y?'&page_y='.$page_y:''));
exit; exit;
} }
@ -425,7 +426,7 @@ if ($mode != 'marketplace')
} }
else else
{ {
print '<a href="modules.php?id='.$objMod->numero.'&amp;action=reset&amp;value=' . $modName . '&amp;mode=' . $mode . '">'; print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&amp;action=reset&amp;value=' . $modName . '&amp;mode=' . $mode . '">';
print img_picto($langs->trans("Activated"),'switch_on'); print img_picto($langs->trans("Activated"),'switch_on');
print '</a>'; print '</a>';
} }
@ -488,7 +489,7 @@ if ($mode != 'marketplace')
else else
{ {
// Module non actif // Module non actif
print '<a href="modules.php?id='.$objMod->numero.'&amp;action=set&amp;value=' . $modName . '&amp;mode=' . $mode . '">'; print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&amp;action=set&amp;value=' . $modName . '&amp;mode=' . $mode . '">';
print img_picto($langs->trans("Disabled"),'switch_off'); print img_picto($langs->trans("Disabled"),'switch_off');
print "</a>\n"; print "</a>\n";
} }

View File

@ -43,8 +43,9 @@ if (!$user->admin)
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
// Supported OAUTH // Supported OAUTH (a provider is supported when a file xxx_oauth2callback.php is available into htdocs/core/modules/oauth)
$supportedoauth2array=array('OAUTH_GOOGLE_NAME'); $supportedoauth2array=array('OAUTH_GOOGLE_NAME'=>'google');
// API access parameters OAUTH // API access parameters OAUTH
$list = array ( $list = array (
array( array(
@ -315,7 +316,7 @@ $var = true;
foreach ($list as $key) foreach ($list as $key)
{ {
$supported=0; $supported=0;
if (in_array($key[0], $supportedoauth2array)) $supported=1; if (in_array($key[0], array_keys($supportedoauth2array))) $supported=1;
if (! $supported) continue; // show only supported if (! $supported) continue; // show only supported
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -325,7 +326,7 @@ foreach ($list as $key)
if ($supported) if ($supported)
{ {
$redirect_uri=$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php'; $redirect_uri=$urlwithroot.'/core/modules/oauth/'.$supportedoauth2array[$key[0]].'_oauthcallback.php';
$var = !$var; $var = !$var;
print '<tr '.$bc[$var].' class="value">'; print '<tr '.$bc[$var].' class="value">';
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>'; print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';

View File

@ -87,7 +87,9 @@ $pid=GETPOST("projectid","int",3);
$status=GETPOST("status"); $status=GETPOST("status");
$type=GETPOST("type"); $type=GETPOST("type");
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); $maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':''); $actioncode=GETPOST("actioncode","array",3) ? GETPOST("actioncode","array",3):(GETPOST("actioncode")=='0'?'0':'');
if(is_array($actioncode))$actioncode =implode(',', $actioncode);
if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
@ -437,7 +439,7 @@ if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resour
if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
$sql.= ' WHERE a.fk_action = ca.id'; $sql.= ' WHERE a.fk_action = ca.id';
$sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'"; if ($actioncode) $sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')";
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid; if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid;

View File

@ -1786,6 +1786,16 @@ if ($action == 'create')
$formmail->fromid = $user->id; $formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
$formmail->trackid='spr'.$object->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'spr'.$object->id);
}
$formmail->withfrom = 1; $formmail->withfrom = 1;
$liste = array(); $liste = array();
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value)

View File

@ -1276,7 +1276,7 @@ if ($action == 'create')
// Ref customer // Ref customer
print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td colspan="2">'; print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td colspan="2">';
print '<input type="text" name="ref_client" value=""></td>'; print '<input type="text" name="ref_client" value="'.GETPOST('ref_client').'"></td>';
print '</tr>'; print '</tr>';
// Third party // Third party
@ -1290,6 +1290,19 @@ if ($action == 'create')
} else { } else {
print '<td colspan="2">'; print '<td colspan="2">';
print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 1); print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 1);
// reload page to retrieve customer informations
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
{
print '<script type="text/javascript">
$(document).ready(function() {
$("#socid").change(function() {
var socid = $(this).val();
// reload page
window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid+"&ref_client="+$("input[name=ref_client]").val();
});
});
</script>';
}
print '</td>'; print '</td>';
} }
print '</tr>' . "\n"; print '</tr>' . "\n";
@ -2304,6 +2317,15 @@ if ($action == 'create')
$formmail->fromid = $user->id; $formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
$formmail->trackid='pro'.$object->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'pro'.$object->id);
}
$formmail->withfrom = 1; $formmail->withfrom = 1;
$liste = array(); $liste = array();
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value)

View File

@ -1346,10 +1346,10 @@ if ($action == 'create' && $user->rights->commande->creer)
// Reference client // Reference client
print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td colspan="2">'; print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td colspan="2">';
if (!empty($conf->global->MAIN_USE_PROPAL_REFCLIENT_FOR_ORDER)) if (!empty($conf->global->MAIN_USE_PROPAL_REFCLIENT_FOR_ORDER) && ! empty($origin) && ! empty($originid))
print '<input type="text" name="ref_client" value="'.$ref_client.'"></td>'; print '<input type="text" name="ref_client" value="'.$ref_client.'"></td>';
else else
print '<input type="text" name="ref_client" value=""></td>'; print '<input type="text" name="ref_client" value="'.GETPOST('ref_client').'"></td>';
print '</tr>'; print '</tr>';
// Client // Client
@ -1363,6 +1363,19 @@ if ($action == 'create' && $user->rights->commande->creer)
} else { } else {
print '<td colspan="2">'; print '<td colspan="2">';
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1); print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1);
// reload page to retrieve customer informations
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
{
print '<script type="text/javascript">
$(document).ready(function() {
$("#socid").change(function() {
var socid = $(this).val();
// reload page
window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid+"&ref_client="+$("input[name=ref_client]").val();
});
});
</script>';
}
print '</td>'; print '</td>';
} }
print '</tr>' . "\n"; print '</tr>' . "\n";
@ -2402,6 +2415,15 @@ if ($action == 'create' && $user->rights->commande->creer)
$formmail->fromid = $user->id; $formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
$formmail->trackid='ord'.$object->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'ord'.$object->id);
}
$formmail->withfrom = 1; $formmail->withfrom = 1;
$liste = array(); $liste = array();
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value)

View File

@ -71,7 +71,7 @@ if ($action == 'validate' && $user->rights->deplacement->creer)
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
} }
@ -89,7 +89,7 @@ else if ($action == 'classifyrefunded' && $user->rights->deplacement->creer)
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
} }
@ -104,7 +104,7 @@ else if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->depl
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -150,7 +150,7 @@ else if ($action == 'add' && $user->rights->deplacement->creer)
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action='create'; $action='create';
} }
} }
@ -190,7 +190,7 @@ else if ($action == 'update' && $user->rights->deplacement->creer)
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
else else
@ -412,7 +412,7 @@ else if ($id)
else else
{ {
/* /*
* Confirmation de la suppression du deplacement * Confirm delete trip
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {

View File

@ -1960,6 +1960,19 @@ if ($action == 'create')
{ {
print '<td colspan="2">'; print '<td colspan="2">';
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1); print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1);
// reload page to retrieve customer informations
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
{
print '<script type="text/javascript">
$(document).ready(function() {
$("#socid").change(function() {
var socid = $(this).val();
// reload page
window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid;
});
});
</script>';
}
print '</td>'; print '</td>';
} }
print '</tr>' . "\n"; print '</tr>' . "\n";
@ -3839,6 +3852,15 @@ else if ($id > 0 || ! empty($ref))
$formmail->fromid = $user->id; $formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
$formmail->trackid='inv'.$object->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'inv'.$object->id);
}
$formmail->withfrom = 1; $formmail->withfrom = 1;
$liste = array(); $liste = array();
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) { foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) {

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net> /* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net> * Copyright (C) 2005-2009 Destailleur Laurent <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) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2015 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
@ -48,7 +48,7 @@ $object = new Facture($db);
/* /*
* Ajout d'un nouveau contact * Add a new contact
*/ */
if ($action == 'addcontact' && $user->rights->facture->creer) if ($action == 'addcontact' && $user->rights->facture->creer)
@ -71,16 +71,16 @@ if ($action == 'addcontact' && $user->rights->facture->creer)
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
$langs->load("errors"); $langs->load("errors");
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
} }
// Bascule du statut d'un contact // Toggle the status of a contact
else if ($action == 'swapstatut' && $user->rights->facture->creer) else if ($action == 'swapstatut' && $user->rights->facture->creer)
{ {
if ($object->fetch($id)) if ($object->fetch($id))
@ -93,7 +93,7 @@ else if ($action == 'swapstatut' && $user->rights->facture->creer)
} }
} }
// Efface un contact // Deletes a contact
else if ($action == 'deletecontact' && $user->rights->facture->creer) else if ($action == 'deletecontact' && $user->rights->facture->creer)
{ {
$object->fetch($id); $object->fetch($id);
@ -124,7 +124,7 @@ $userstatic=new User($db);
/* *************************************************************************** */ /* *************************************************************************** */
/* */ /* */
/* Mode vue et edition */ /* View and edit mode */
/* */ /* */
/* *************************************************************************** */ /* *************************************************************************** */
@ -139,7 +139,7 @@ if ($id > 0 || ! empty($ref))
dol_fiche_head($head, 'contact', $langs->trans('InvoiceCustomer'), 0, 'bill'); dol_fiche_head($head, 'contact', $langs->trans('InvoiceCustomer'), 0, 'bill');
/* /*
* Facture synthese pour rappel * Summary invoice for reminder
*/ */
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -70,7 +70,7 @@ if ($action == 'add')
{ {
if (! GETPOST('titre')) if (! GETPOST('titre'))
{ {
setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->trans("Title")), 'errors'); setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->trans("Title")), null, 'errors');
$action = "create"; $action = "create";
$error++; $error++;
} }
@ -88,13 +88,13 @@ if ($action == 'add')
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = "create"; $action = "create";
} }
} }
} }
// Suppression // Delete
if ($action == 'delete' && $user->rights->facture->supprimer) if ($action == 'delete' && $user->rights->facture->supprimer)
{ {
$object->fetch($id); $object->fetch($id);

View File

@ -107,14 +107,14 @@ if ($action == 'presend' && GETPOST('sendmail'))
if (!isset($user->email)) if (!isset($user->email))
{ {
$error++; $error++;
setEventMessage("NoSenderEmailDefined"); setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings');
} }
$countToSend = count($_POST['toSend']); $countToSend = count($_POST['toSend']);
if (empty($countToSend)) if (empty($countToSend))
{ {
$error++; $error++;
setEventMessage("InvoiceNotChecked","warnings"); setEventMessages($langs->trans("InvoiceNotChecked"), null, 'warnings');
} }
if (! $error) if (! $error)
@ -260,11 +260,11 @@ if ($action == 'presend' && GETPOST('sendmail'))
if ($nbsent) if ($nbsent)
{ {
$action=''; // Do not show form post if there was at least one successfull sent $action=''; // Do not show form post if there was at least one successfull sent
setEventMessage($nbsent. '/'.$countToSend.' '.$langs->trans("RemindSent")); setEventMessages($nbsent. '/'.$countToSend.' '.$langs->trans("RemindSent"), null, 'mesgs');
} }
else else
{ {
setEventMessage($langs->trans("NoRemindSent"), 'warnings'); // May be object has no generated PDF file setEventMessages($langs->trans("NoRemindSent"), null, 'warnings'); // May be object has no generated PDF file
} }
} }
} }
@ -349,16 +349,16 @@ if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_s
@chmod($file, octdec($conf->global->MAIN_UMASK)); @chmod($file, octdec($conf->global->MAIN_UMASK));
$langs->load("exports"); $langs->load("exports");
setEventMessage($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog'))); setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs');
} }
else else
{ {
setEventMessage($langs->trans('NoPDFAvailableForChecked'),'errors'); setEventMessages($langs->trans('NoPDFAvailableForChecked'), null, 'errors');
} }
} }
else else
{ {
setEventMessage($langs->trans('InvoiceNotChecked'), 'warnings'); setEventMessages($langs->trans('InvoiceNotChecked'), null, 'warnings');
} }
} }
@ -371,8 +371,8 @@ if ($action == 'remove_file')
$upload_dir = $diroutputpdf; $upload_dir = $diroutputpdf;
$file = $upload_dir . '/' . GETPOST('file'); $file = $upload_dir . '/' . GETPOST('file');
$ret=dol_delete_file($file); $ret=dol_delete_file($file);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
$action=''; $action='';
} }
@ -574,6 +574,15 @@ if ($resql)
$formmail->fromid = $user->id; $formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
$formmail->trackid='inv'.$object->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'inv'.$object->id);
}
$formmail->withfrom=1; $formmail->withfrom=1;
$liste=array(); $liste=array();
$formmail->withto=$langs->trans("AllRecipientSelectedForRemind"); $formmail->withto=$langs->trans("AllRecipientSelectedForRemind");

View File

@ -75,12 +75,12 @@ if ($action == "new")
{ {
$db->commit(); $db->commit();
setEventMessage($langs->trans("RecordSaved")); setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
} }
else else
{ {
$db->rollback(); $db->rollback();
setEventMessage($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
$action=''; $action='';

View File

@ -66,7 +66,7 @@ if ($action == 'setnote' && $user->rights->facture->paiement)
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$db->rollback(); $db->rollback();
} }
} }
@ -86,7 +86,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->
else else
{ {
$langs->load("errors"); $langs->load("errors");
setEventMessage($langs->trans($object->error), 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$db->rollback(); $db->rollback();
} }
} }
@ -124,7 +124,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture->
else else
{ {
$langs->load("errors"); $langs->load("errors");
setEventMessage($langs->trans($object->error), 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$db->rollback(); $db->rollback();
} }
} }
@ -135,11 +135,11 @@ if ($action == 'setnum_paiement' && ! empty($_POST['num_paiement']))
$res = $object->update_num($_POST['num_paiement']); $res = $object->update_num($_POST['num_paiement']);
if ($res === 0) if ($res === 0)
{ {
setEventMessage($langs->trans('PaymentNumberUpdateSucceeded')); setEventMessages($langs->trans('PaymentNumberUpdateSucceeded'), null, 'mesgs');
} }
else else
{ {
setEventMessage($langs->trans('PaymentNumberUpdateFailed'), 'errors'); setEventMessages($langs->trans('PaymentNumberUpdateFailed'), null, 'errors');
} }
} }
@ -150,11 +150,11 @@ if ($action == 'setdatep' && ! empty($_POST['datepday']))
$res = $object->update_date($datepaye); $res = $object->update_date($datepaye);
if ($res === 0) if ($res === 0)
{ {
setEventMessage($langs->trans('PaymentDateUpdateSucceeded')); setEventMessages($langs->trans('PaymentDateUpdateSucceeded'), null, 'mesgs');
} }
else else
{ {
setEventMessage($langs->trans('PaymentDateUpdateFailed'), 'errors'); setEventMessages($langs->trans('PaymentDateUpdateFailed'), null, 'errors');
} }
} }

View File

@ -79,12 +79,12 @@ if ($action == 'setdate' && $user->rights->banque->cheque)
$result=$object->set_date($user,$date); $result=$object->set_date($user,$date);
if ($result < 0) if ($result < 0)
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -98,12 +98,12 @@ if ($action == 'setrefext' && $user->rights->banque->cheque)
$result=$object->setValueFrom('ref_ext', $ref_ext); $result=$object->setValueFrom('ref_ext', $ref_ext);
if ($result < 0) if ($result < 0)
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -117,12 +117,12 @@ if ($action == 'setref' && $user->rights->banque->cheque)
$result=$object->set_number($user,$number); $result=$object->set_number($user,$number);
if ($result < 0) if ($result < 0)
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -154,12 +154,12 @@ if ($action == 'create' && $_POST["accountid"] > 0 && $user->rights->banque->che
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
else else
{ {
setEventMessage($langs->trans("ErrorSelectAtLeastOne")); setEventMessages($langs->trans("ErrorSelectAtLeastOne"), null, 'mesgs');
$action='new'; $action='new';
} }
} }
@ -175,7 +175,7 @@ if ($action == 'remove' && $id > 0 && $_GET["lineid"] > 0 && $user->rights->banq
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -190,7 +190,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->c
} }
else else
{ {
setEventMessage($paiement->error, 'errors'); setEventMessages($paiement->error, $paiement->errors, 'errors');
} }
} }
@ -217,7 +217,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->banque->c
} }
else else
{ {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -230,7 +230,7 @@ if ($action == 'confirm_reject_check' && $confirm == 'yes' && $user->rights->ban
$paiement_id = $object->rejectCheck($rejected_check, $reject_date); $paiement_id = $object->rejectCheck($rejected_check, $reject_date);
if ($paiement_id > 0) if ($paiement_id > 0)
{ {
setEventMessage($langs->trans("CheckRejectedAndInvoicesReopened")); setEventMessages($langs->trans("CheckRejectedAndInvoicesReopened"), null, 'mesgs');
//header("Location: ".DOL_URL_ROOT.'/compta/paiement/card.php?id='.$paiement_id); //header("Location: ".DOL_URL_ROOT.'/compta/paiement/card.php?id='.$paiement_id);
//exit; //exit;
$action=''; $action='';
@ -282,8 +282,8 @@ else if ($action == 'remove_file' && $user->rights->banque->cheque)
$file=$dir.get_exdir($object->number,0,1,0,$object,'cheque') . GETPOST('file'); $file=$dir.get_exdir($object->number,0,1,0,$object,'cheque') . GETPOST('file');
$ret=dol_delete_file($file,0,0,0,$object); $ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file'))); if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors'); else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
} }
} }

View File

@ -221,11 +221,12 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$filename = $attachedfiles['names']; $filename = $attachedfiles['names'];
$mimetype = $attachedfiles['mimes']; $mimetype = $attachedfiles['mimes'];
$trackid = GETPOST('trackid','aZ'); $trackid = GETPOST('trackid','aZ09');
if($conf->dolimail->enabled) // Feature to push mail sent into Sent folder
if (! empty($conf->dolimail->enabled))
{ {
$mailfromid = explode ("#", $_POST['frommail'],3); $mailfromid = explode("#", $_POST['frommail'],3); // $_POST['frommail'] = 'aaa#Sent# <aaa@aaa.com>' // TODO Use a better way to define Sent dir.
if (count($mailfromid)==0) $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; if (count($mailfromid)==0) $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
else else
{ {
@ -243,7 +244,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
{ {
$folder=str_replace($ref, '', $mailboxconfig->folder_cache_key); $folder=str_replace($ref, '', $mailboxconfig->folder_cache_key);
if (!$folder) $folder = "Sent"; if (!$folder) $folder = "Sent"; // Default Sent folder
$mailboxconfig->mbox = imap_open($mailboxconfig->get_connector_url().$folder, $mailboxconfig->mailbox_imap_login, $mailboxconfig->mailbox_imap_password); $mailboxconfig->mbox = imap_open($mailboxconfig->get_connector_url().$folder, $mailboxconfig->mailbox_imap_login, $mailboxconfig->mailbox_imap_password);
if (FALSE === $mailboxconfig->mbox) if (FALSE === $mailboxconfig->mbox)
@ -276,13 +277,12 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
if ($result) if ($result)
{ {
$error=0; $error=0;
if($conf->dolimail->enabled) if (! empty($conf->dolimail->enabled))
{ {
$mid = (GETPOST('mid','int') ? GETPOST('mid','int') : 0); $mid = (GETPOST('mid','int') ? GETPOST('mid','int') : 0); // Original mail id is set ?
if ($mid) if ($mid)
{ {
// set imap flag answered if it is a answered mail // set imap flag answered if it is an answered mail
$dolimail=new DoliMail($db); $dolimail=new DoliMail($db);
$dolimail->id = $mid; $dolimail->id = $mid;
$res=$dolimail->set_prop($user, 'answered',1); $res=$dolimail->set_prop($user, 'answered',1);

View File

@ -708,8 +708,10 @@ class CMailFile
$trackid = $this->trackid; $trackid = $this->trackid;
if ($trackid) if ($trackid)
{ {
$out.= 'Message-ID: <' . time() . '.phpmail-'.$trackid.'@' . $host . ">" . $this->eol2; // References is kept in response and Message-ID is returned into In-Reply-To:
$out.= 'references: <' . time() . '.phpmail-'.$trackid.'@' . $host . ">" . $this->eol2; $out.= 'Message-ID: <' . time() . '.phpmail-dolibarr-'.$trackid.'@' . $host . ">" . $this->eol2; // Uppercase seems replaced by phpmail
$out.= 'References: <' . time() . '.phpmail-dolibarr-'.$trackid.'@' . $host . ">" . $this->eol2;
$out.= 'X-Dolibarr-TRACKID: '.$trackid. $this->eol2;
} }
else else
{ {

View File

@ -418,6 +418,7 @@ class Conf
// conf->mailing->email_from = email pour envoi par Dolibarr des mailings // conf->mailing->email_from = email pour envoi par Dolibarr des mailings
$this->mailing->email_from=$this->email_from; $this->mailing->email_from=$this->email_from;
if (! empty($this->global->MAILING_EMAIL_FROM)) $this->mailing->email_from=$this->global->MAILING_EMAIL_FROM; if (! empty($this->global->MAILING_EMAIL_FROM)) $this->mailing->email_from=$this->global->MAILING_EMAIL_FROM;
if (! isset($conf->global->MAIN_EMAIL_ADD_TRACK_ID)) $conf->global->MAIN_EMAIL_ADD_TRACK_ID=1;
// Format for date (used by default when not found or not searched in lang) // Format for date (used by default when not found or not searched in lang)
$this->format_date_short="%d/%m/%Y"; // Format of day with PHP/C tags (strftime functions) $this->format_date_short="%d/%m/%Y"; // Format of day with PHP/C tags (strftime functions)

View File

@ -4687,7 +4687,7 @@ class Form
foreach ($array as $key => $value) foreach ($array as $key => $value)
{ {
$out.= '<option value="'.$key.'"'; $out.= '<option value="'.$key.'"';
if (is_array($selected) && ! empty($selected) && in_array($key, $selected)) if (is_array($selected) && ! empty($selected) && in_array($key, $selected) && !empty($key))
{ {
$out.= ' selected'; $out.= ' selected';
} }
@ -4828,7 +4828,7 @@ class Form
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text
foreach($ways as $way) foreach($ways as $way)
{ {
$toprint[] = '<li class="select2-search-choice-dolibarr"'.($c->color?' style="background: #'.$c->color.'"':'').'>'.img_object('','category').' '.$way.'</li>'; $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color?' style="background: #'.$c->color.';"':'').'>'.img_object('','category').' '.$way.'</li>';
} }
} }
return '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; return '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';

View File

@ -247,9 +247,10 @@ class FormActions
* @param string $excludetype Type to exclude * @param string $excludetype Type to exclude
* @param string $onlyautoornot Group list by auto events or not: We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO) * @param string $onlyautoornot Group list by auto events or not: We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO)
* @param int $hideinfohelp 1=Do not show info help * @param int $hideinfohelp 1=Do not show info help
* @param int $multiselect 1=Allow multiselect of action type for filter or search
* @return void * @return void
*/ */
function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0) function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=0)
{ {
global $langs,$user,$form,$conf; global $langs,$user,$form,$conf;
@ -269,7 +270,16 @@ class FormActions
if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO)) unset($arraylist['AC_OTH_AUTO']); if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO)) unset($arraylist['AC_OTH_AUTO']);
if($multiselect==1) {
if(!is_array($selected) && !empty($selected)) $selected = explode(',', $selected);
print $form->multiselectarray($htmlname, $arraylist,$selected,0, 0, '', 0, 200);
}
else {
print $form->selectarray($htmlname, $arraylist, $selected); print $form->selectarray($htmlname, $arraylist, $selected);
}
if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
} }

View File

@ -1133,8 +1133,10 @@ class SMTPs
$trackid = $this->getTrackId(); $trackid = $this->getTrackId();
if ($trackid) if ($trackid)
{ {
$_header .= 'Message-ID: <' . time() . '.SMTPs-'.$trackid.'@' . $host . ">\r\n"; // References is kept in response and Message-ID is returned into In-Reply-To:
$_header .= 'references: <' . time() . '.SMTPs-'.$trackid.'@' . $host . ">\r\n"; $_header .= 'Message-ID: <' . time() . '.SMTPs-dolibarr-'.$trackid.'@' . $host . ">\r\n";
$_header .= 'References: <' . time() . '.SMTPs-dolibarr-'.$trackid.'@' . $host . ">\r\n";
$_header .= 'X-Dolibarr-TRACKID: ' . $trackid . "\r\n";
} }
else else
{ {

View File

@ -925,27 +925,16 @@ function copyToClipboard(text,text2)
/* /*
* Timer for delayed keyup function * Provide a function to get an URL GET parameter in javascript
* *
* TODO Who use this ? * @param string name Name of parameter
* @param mixed valueifnotfound Value if not found
* @return string Value
*/ */
/* function getParameterByName(name, valueifnotfound)
(function($){ {
$.widget("ui.onDelayedKeyup", { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
_init : function() { var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
var self = this; results = regex.exec(location.search);
$(this.element).bind('keyup input', function() { return results === null ? valueifnotfound : decodeURIComponent(results[1].replace(/\+/g, " "));
if(typeof(window['inputTimeout']) != "undefined"){ }
window.clearTimeout(inputTimeout);
}
var handler = self.options.handler;
window['inputTimeout'] = window.setTimeout(function() { handler.call(self.element) }, self.options.delay);
});
},
options: {
handler: $.noop(),
delay: 500
}
});
})(jQuery);
*/

View File

@ -53,7 +53,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
$langs->load("companies"); $langs->load("companies");
// Filters // Filters
print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="get">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">'; print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="year" value="' . $year . '">'; print '<input type="hidden" name="year" value="' . $year . '">';
print '<input type="hidden" name="month" value="' . $month . '">'; print '<input type="hidden" name="month" value="' . $month . '">';
@ -86,7 +86,8 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';
print $langs->trans("Type"); print $langs->trans("Type");
print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone" style="padding-bottom: 2px; padding-right: 4px;">'; print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone" style="padding-bottom: 2px; padding-right: 4px;">';
print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0)); //select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=true)
print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0), 0, 1);
print '</td></tr>'; print '</td></tr>';
print '<tr>'; print '<tr>';

View File

@ -263,6 +263,10 @@ function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL)
$out=trim($out); $out=trim($out);
if (preg_match('/[^a-z]+/i',$out)) $out=''; if (preg_match('/[^a-z]+/i',$out)) $out='';
break; break;
case 'aZ09':
$out=trim($out);
if (preg_match('/[^a-z0-9]+/i',$out)) $out='';
break;
case 'array': case 'array':
if (! is_array($out) || empty($out)) $out=array(); if (! is_array($out) || empty($out)) $out=array();
break; break;
@ -5043,6 +5047,22 @@ function printCommonFooter($zone='private')
if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER."\n"; if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER."\n";
print "\n";
print '<script type="text/javascript" language="javascript">jQuery(document).ready(function() {'."\n";
print '<!-- If page_y set, we set scollbar with it -->'."\n";
print "page_y=getParameterByName('page_y', 0);";
print "if (page_y > 0) $('html, body').scrollTop(page_y);";
print '<!-- Set handler to add page_y param on some a href links -->'."\n";
print 'jQuery(".reposition").click(function() {
var page_y = $(document).scrollTop();
this.href=this.href+\'&page_y=\'+page_y;
});';
print '});'."\n";
print '</script>'."\n";
// Google Analytics (need Google module) // Google Analytics (need Google module)
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID)) if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID))
{ {

View File

@ -24,10 +24,8 @@
require '../../../main.inc.php'; require '../../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
use OAuth\Common\Storage\Session;
use OAuth\Common\Storage\DoliStorage; use OAuth\Common\Storage\DoliStorage;
use OAuth\Common\Consumer\Credentials; use OAuth\Common\Consumer\Credentials;
use OAuth\Common\Token\TokenInterface;
use OAuth\OAuth2\Service\Google; use OAuth\OAuth2\Service\Google;
// Define $urlwithroot // Define $urlwithroot
@ -72,11 +70,18 @@ $credentials = new Credentials(
$currentUri->getAbsoluteUri() $currentUri->getAbsoluteUri()
); );
$requestedpermissionsarray=array();
if (GETPOST('state')) $requestedpermissionsarray=explode(',', GETPOST('state')); // Example: 'userinfo_email,userinfo_profile,cloud_print'. 'state' parameter is standard to retrieve some parameters back
if ($action != 'delete' && empty($requestedpermissionsarray))
{
print 'Error, parameter state is not defined';
exit;
}
//var_dump($requestedpermissionsarray);exit;
// Instantiate the Api service using the credentials, http client and storage mechanism for the token // Instantiate the Api service using the credentials, http client and storage mechanism for the token
/** @var $apiService Service */ /** @var $apiService Service */
// TODO remove hardcoded array $apiService = $serviceFactory->createService('Google', $credentials, $storage, $requestedpermissionsarray);
$apiService = $serviceFactory->createService('Google', $credentials, $storage, array('userinfo_email', 'userinfo_profile', 'cloud_print'));
// access type needed for google refresh token // access type needed for google refresh token
$apiService->setAccessType('offline'); $apiService->setAccessType('offline');
@ -129,11 +134,18 @@ if (! empty($_GET['code'])) // We are coming from Google oauth page
header('Location: ' . $backtourl); header('Location: ' . $backtourl);
exit(); exit();
} }
else else // If entry on page with no parameter, we arrive here
{ {
$_SESSION["backtourlsavedbeforeoauthjump"]=$backtourl; $_SESSION["backtourlsavedbeforeoauthjump"]=$backtourl;
$url = $apiService->getAuthorizationUri(); if (GETPOST('state'))
{
$url = $apiService->getAuthorizationUri(array('state'=>GETPOST('state')));
}
else
{
$url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated
}
// we go on google authorization page // we go on google authorization page
header('Location: ' . $url); header('Location: ' . $url);
exit(); exit();

View File

@ -113,18 +113,20 @@ class printing_printgcp extends PrintingDriver
if ($this->google_id != '' && $this->google_secret != '') { if ($this->google_id != '' && $this->google_secret != '') {
$this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>'GoogleAuthConfigured', 'type'=>'info'); $this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>'GoogleAuthConfigured', 'type'=>'info');
$this->conf[] = array('varname'=>'PRINTGCP_TOKEN_ACCESS', 'info'=>$access, 'type'=>'info'); $this->conf[] = array('varname'=>'PRINTGCP_TOKEN_ACCESS', 'info'=>$access, 'type'=>'info', 'renew'=>$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php?state=userinfo_email,userinfo_profile,cloud_print&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'delete'=>($storage->hasAccessToken('Google')?$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'):''));
if ($token_ok) { if ($token_ok) {
$refreshtoken = $token->getRefreshToken(); $refreshtoken = $token->getRefreshToken();
$this->conf[] = array('varname'=>'PRINTGCP_TOKEN_REFRESH', 'info'=>((! empty($refreshtoken))?'Yes':'No'), 'type'=>'info'); $this->conf[] = array('varname'=>'PRINTGCP_TOKEN_REFRESH', 'info'=>((! empty($refreshtoken))?'Yes':'No'), 'type'=>'info');
$this->conf[] = array('varname'=>'PRINTGCP_TOKEN_EXPIRED', 'info'=>($expire?'Yes':'No'), 'type'=>'info'); $this->conf[] = array('varname'=>'PRINTGCP_TOKEN_EXPIRED', 'info'=>($expire?'Yes':'No'), 'type'=>'info');
$this->conf[] = array('varname'=>'PRINTGCP_TOKEN_EXPIRE_AT', 'info'=>(dol_print_date($token->getEndOfLife(), "dayhour")), 'type'=>'info'); $this->conf[] = array('varname'=>'PRINTGCP_TOKEN_EXPIRE_AT', 'info'=>(dol_print_date($token->getEndOfLife(), "dayhour")), 'type'=>'info');
} }
if (!$storage->hasAccessToken('Google')) { /*
if ($storage->hasAccessToken('Google')) {
$this->conf[] = array('varname'=>'PRINTGCP_AUTHLINK', 'link'=>$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php?backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'type'=>'authlink'); $this->conf[] = array('varname'=>'PRINTGCP_AUTHLINK', 'link'=>$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php?backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'type'=>'authlink');
} else {
$this->conf[] = array('varname'=>'PRINTGCP_DELETE_TOKEN', 'link'=>$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'type'=>'delete'); $this->conf[] = array('varname'=>'PRINTGCP_DELETE_TOKEN', 'link'=>$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'type'=>'delete');
} } else {
$this->conf[] = array('varname'=>'PRINTGCP_AUTHLINK', 'link'=>$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php?backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'type'=>'authlink');
}*/
} else { } else {
$this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>'GoogleAuthNotConfigured', 'type'=>'info'); $this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>'GoogleAuthNotConfigured', 'type'=>'info');
} }

View File

@ -1620,6 +1620,15 @@ else if ($id || $ref)
$formmail->fromid = $user->id; $formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
$formmail->trackid='shi'.$object->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'shi'.$object->id);
}
$formmail->withfrom=1; $formmail->withfrom=1;
$liste=array(); $liste=array();
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;

View File

@ -1816,6 +1816,15 @@ else if ($id > 0 || ! empty($ref))
$formmail->fromid = $user->id; $formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
$formmail->trackid='int'.$object->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'int'.$object->id);
}
$formmail->withfrom=1; $formmail->withfrom=1;
$liste=array(); $liste=array();
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;

View File

@ -2321,6 +2321,15 @@ elseif (! empty($object->id))
$formmail->fromid = $user->id; $formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
$formmail->trackid='sor'.$object->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'sor'.$object->id);
}
$formmail->withfrom=1; $formmail->withfrom=1;
$liste=array(); $liste=array();
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;

View File

@ -2322,6 +2322,15 @@ else
$formmail->fromid = $user->id; $formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 1)) // If bit 1 is set
{
$formmail->trackid='sin'.$object->id;
}
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'sin'.$object->id);
}
$formmail->withfrom=1; $formmail->withfrom=1;
$liste=array(); $liste=array();
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;

View File

@ -284,7 +284,7 @@ IMG;
private function _parse($type='content') private function _parse($type='content')
{ {
// Search all tags fou into condition to complete $this->vars, so we will proceed all tests even if not defined // Search all tags fou into condition to complete $this->vars, so we will proceed all tests even if not defined
$reg='@\[!--\sIF\s([{}a-zA-Z_]+)\s--\]@smU'; $reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU';
preg_match_all($reg, $this->contentXml, $matches, PREG_SET_ORDER); preg_match_all($reg, $this->contentXml, $matches, PREG_SET_ORDER);
//var_dump($this->vars);exit; //var_dump($this->vars);exit;
foreach($matches as $match) // For each match, if there is no entry into this->vars, we add it foreach($matches as $match) // For each match, if there is no entry into this->vars, we add it

View File

@ -32,6 +32,8 @@ INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_SIZE_SHOR
ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32); ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32);
ALTER TABLE llx_accountingaccount MODIFY COLUMN fk_pcg_version varchar(32); ALTER TABLE llx_accountingaccount MODIFY COLUMN fk_pcg_version varchar(32);
ALTER TABLE llx_accountingaccount RENAME TO llx_accounting_account;
ALTER TABLE llx_accounting_account ADD INDEX idx_accounting_account_account_number (account_number);
UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_PREFIX_SPEC')__ WHERE __DECRYPT('name')__ = 'EXPORT_PREFIX_SPEC'; UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_PREFIX_SPEC')__ WHERE __DECRYPT('name')__ = 'EXPORT_PREFIX_SPEC';
@ -40,8 +42,6 @@ UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'b
UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'amarok'; UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'amarok';
UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'cameleo'; UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'cameleo';
ALTER TABLE llx_accountingaccount RENAME TO llx_accounting_account;
ALTER TABLE llx_societe ADD COLUMN model_pdf varchar(255); ALTER TABLE llx_societe ADD COLUMN model_pdf varchar(255);
ALTER TABLE llx_societe_commerciaux ADD COLUMN import_key varchar(14) AFTER fk_user; ALTER TABLE llx_societe_commerciaux ADD COLUMN import_key varchar(14) AFTER fk_user;

View File

@ -19,6 +19,7 @@
ALTER TABLE llx_accounting_account ADD INDEX idx_accounting_account_fk_pcg_version (fk_pcg_version); ALTER TABLE llx_accounting_account ADD INDEX idx_accounting_account_fk_pcg_version (fk_pcg_version);
ALTER TABLE llx_accounting_account ADD INDEX idx_accounting_account_account_number (account_number);
ALTER TABLE llx_accounting_account ADD CONSTRAINT fk_accounting_account_fk_pcg_version FOREIGN KEY (fk_pcg_version) REFERENCES llx_accounting_system (pcg_version); ALTER TABLE llx_accounting_account ADD CONSTRAINT fk_accounting_account_fk_pcg_version FOREIGN KEY (fk_pcg_version) REFERENCES llx_accounting_system (pcg_version);

View File

@ -1,9 +1,12 @@
# Dolibarr language file - Source file is en_US - oauth # Dolibarr language file - Source file is en_US - oauth
ConfigOAuth=Oauth Configuration ConfigOAuth=Oauth Configuration
NoAccessToken=No token access saved. NoAccessToken=No access token saved into local database
HasAccessToken=A token was generated and saved into database HasAccessToken=A token was generated and saved into local database
NewTokenStored=Token received ans saved NewTokenStored=Token received ans saved
ToCheckDeleteTokenOnProvider=To check/delete authorization saved by %s OAuth provider
TokenDeleted=Token deleted TokenDeleted=Token deleted
RequestAccess=Click here to request/renew access and receive a new token to save
DeleteAccess=Click here to delete token
UseTheFollowingUrlAsRedirectURI=Use the following URL as the Redirect URI when creating your credential on your OAuth provider: UseTheFollowingUrlAsRedirectURI=Use the following URL as the Redirect URI when creating your credential on your OAuth provider:
ListOfSupportedOauthProviders=Enter here credential provided by your OAuth2 provider. Only supported OAuth2 providers are visible here. This setup may be used by other modules than need OAuth2 authentication. ListOfSupportedOauthProviders=Enter here credential provided by your OAuth2 provider. Only supported OAuth2 providers are visible here. This setup may be used by other modules than need OAuth2 authentication.
OAUTH_AMAZON_NAME=Api Amazon OAUTH_AMAZON_NAME=Api Amazon

View File

@ -18,15 +18,13 @@ TestDriver=Test
TargetedPrinter=Targeted printer TargetedPrinter=Targeted printer
UserConf=Setup per user UserConf=Setup per user
PRINTGCP=Google Cloud Print PRINTGCP=Google Cloud Print
PRINTGCP_INFO=Google Api State PRINTGCP_INFO=Google OAuth API setup
PRINTGCP_AUTHLINK=Authentication PRINTGCP_AUTHLINK=Authentication
PRINTGCP_TOKEN_ACCESS=Google Cloud Print OAuth Token PRINTGCP_TOKEN_ACCESS=Google Cloud Print OAuth Token
PRINTGCP_TOKEN_REFRESH=Token Refresh Present PRINTGCP_TOKEN_REFRESH=Token Refresh Present
PRINTGCP_TOKEN_EXPIRED=Token Expired PRINTGCP_TOKEN_EXPIRED=Token Expired
PRINTGCP_TOKEN_EXPIRE_AT=Token expire at PRINTGCP_TOKEN_EXPIRE_AT=Token expire at
PRINTGCP_DELETE_TOKEN=Delete saved token PRINTGCP_DELETE_TOKEN=Delete saved token
RequestAccess=Click here to request access and receive a token to save
DeleteAccess=Click here to delete token
PrintGCPDesc=This driver allow to send documents directly to a printer with Google Cloud Print. PrintGCPDesc=This driver allow to send documents directly to a printer with Google Cloud Print.
PrintingDriverDescprintgcp=Configuration variables for printing driver Google Cloud Print. PrintingDriverDescprintgcp=Configuration variables for printing driver Google Cloud Print.
PrintTestDescprintgcp=List of Printers for Google Cloud Print. PrintTestDescprintgcp=List of Printers for Google Cloud Print.

View File

@ -1605,16 +1605,16 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra
$langs->load("users"); $langs->load("users");
$searchform.=printSearchForm(DOL_URL_ROOT.'/user/list.php', DOL_URL_ROOT.'/user/list.php', $langs->trans("Users"), 'user', 'sall', 'M', 'searchleftuser', img_object('','user')); $searchform.=printSearchForm(DOL_URL_ROOT.'/user/list.php', DOL_URL_ROOT.'/user/list.php', $langs->trans("Users"), 'user', 'sall', 'M', 'searchleftuser', img_object('','user'));
} }
}
// Execute hook printSearchForm // Execute hook printSearchForm
$parameters=array(); $parameters=array('searchform'=>$searchform);
$reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) if (empty($reshook))
{ {
$searchform.=$hookmanager->resPrint; $searchform.=$hookmanager->resPrint;
} }
else $searchform=$hookmanager->resPrint; else $searchform=$hookmanager->resPrint;
}
// Define $bookmarks // Define $bookmarks
if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire)

View File

@ -124,11 +124,12 @@ if ($socid > 0)
print "</table>"; print "</table>";
dol_fiche_end();
print '</div>'; print '</div>';
print '<div style="clear:both"></div>'; print '<div style="clear:both"></div>';
dol_fiche_end();
print '<br>';
$sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,"; $sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,";
$sql.= " f.rowid as facid, f.facnumber, f.total as total_ht,"; $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht,";

View File

@ -45,6 +45,7 @@ if (! empty($driver)) $langs->load($driver);
if (!$mode) $mode='config'; if (!$mode) $mode='config';
/* /*
* Action * Action
*/ */
@ -155,25 +156,18 @@ if ($mode == 'setup' && $user->admin)
print '<td>&nbsp;'.($key['example']!=''?$langs->trans("Example").' : '.$key['example']:'').'</td>'; print '<td>&nbsp;'.($key['example']!=''?$langs->trans("Example").' : '.$key['example']:'').'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
break; break;
case "authlink": case "info": // Google Api setup or Google OAuth Token
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans($key['varname']).'</td>';
print '<td><a class="button" href="'.$key['link'].'">'.$langs->trans('RequestAccess').'</a></td>';
print '<td>&nbsp;</td>';
print '</tr>'."\n";
break;
case "delete":
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans($key['varname']).'</td>';
print '<td><a class="button" href="'.$key['link'].'">'.$langs->trans('DeleteAccess').'</a></td>';
print '<td>&nbsp;</td>';
print '</tr>'."\n";
break;
case "info":
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td'.($key['required']?' class=required':'').'>'.$langs->trans($key['varname']).'</td>'; print '<td'.($key['required']?' class=required':'').'>'.$langs->trans($key['varname']).'</td>';
print '<td>'.$langs->trans($key['info']).'</td>'; print '<td>'.$langs->trans($key['info']).'</td>';
print '<td>&nbsp;</td>'; print '<td>';
if ($key['varname'] == 'PRINTGCP_TOKEN_ACCESS')
{
if (! empty($key['delete'])) print '<a class="button" href="'.$key['delete'].'">'.$langs->trans('DeleteAccess').'</a><br><br>';
print '<a class="button" href="'.$key['renew'].'">'.$langs->trans('RequestAccess').'</a><br><br>';
print $langs->trans("ToCheckDeleteTokenOnProvider", 'Google').': <a href="https://security.google.com/settings/security/permissions" target="_google">https://security.google.com/settings/security/permissions</a>';
}
print '</td>';
print '</tr>'."\n"; print '</tr>'."\n";
break; break;
case "submit": case "submit":
@ -225,7 +219,7 @@ if ($mode == 'config' && $user->admin)
//print '<pre>'.print_r($printer, true).'</pre>'; //print '<pre>'.print_r($printer, true).'</pre>';
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.img_picto('', $printer->picto).$langs->trans($printer->desc).'</td>'; print '<td>'.img_picto('', $printer->picto).' '.$langs->trans($printer->desc).'</td>';
print '<td class="center">'; print '<td class="center">';
if (! empty($conf->use_javascript_ajax)) if (! empty($conf->use_javascript_ajax))
{ {

View File

@ -43,7 +43,7 @@ function printingadmin_prepare_head($mode)
if ($mode == 'setup') if ($mode == 'setup')
{ {
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=setup"; $head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=setup&driver=".GETPOST('driver','alpha');
$head[$h][1] = $langs->trans("SetupDriver"); $head[$h][1] = $langs->trans("SetupDriver");
$head[$h][2] = 'setup'; $head[$h][2] = 'setup';
$h++; $h++;
@ -51,7 +51,7 @@ function printingadmin_prepare_head($mode)
if ($mode == 'test') if ($mode == 'test')
{ {
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=test"; $head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=test&driver=".GETPOST('driver','alpha');
$head[$h][1] = $langs->trans("TargetedPrinter"); $head[$h][1] = $langs->trans("TargetedPrinter");
$head[$h][2] = 'test'; $head[$h][2] = 'test';
$h++; $h++;

View File

@ -179,12 +179,6 @@ if (empty($reshook))
); );
} }
if (!$error && $object->update($object->id, $user) < 1) {
$error++;
setEventMessage($object->error, 'errors');
$action = 'edit_price';
}
if (!$error) { if (!$error) {
$db->begin(); $db->begin();
@ -215,6 +209,11 @@ if (empty($reshook))
} }
} }
if (!$error && $object->update($object->id, $user) < 0) {
$error++;
setEventMessage($object->error, 'errors');
}
if (empty($error)) { if (empty($error)) {
$action = ''; $action = '';
setEventMessage($langs->trans("RecordSaved")); setEventMessage($langs->trans("RecordSaved"));
@ -793,7 +792,7 @@ if ($action == 'edit_vat' && ($user->rights->produit->creer || $user->rights->se
print '<br></form><br>'; print '<br></form><br>';
} }
if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->service->creer)) if ($action == 'edit_price' && $object->getRights()->creer)
{ {
print load_fiche_titre($langs->trans("NewPrice"), ''); print load_fiche_titre($langs->trans("NewPrice"), '');
@ -809,7 +808,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// VAT // VAT
print '<tr><td>' . $langs->trans("VATRate") . '</td><td>'; print '<tr><td>' . $langs->trans("VATRate") . '</td><td colspan="2">';
print $form->load_tva("tva_tx", $object->tva_tx, $mysoc, '', $object->id, $object->tva_npr); print $form->load_tva("tva_tx", $object->tva_tx, $mysoc, '', $object->id, $object->tva_npr);
print '</td></tr>'; print '</td></tr>';
@ -817,7 +816,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
print '<tr><td width="20%">'; print '<tr><td width="20%">';
print $langs->trans('PriceBase'); print $langs->trans('PriceBase');
print '</td>'; print '</td>';
print '<td>'; print '<td colspan="2">';
print $form->selectPriceBaseType($object->price_base_type, "price_base_type"); print $form->selectPriceBaseType($object->price_base_type, "price_base_type");
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -825,7 +824,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
// Only show price mode and expression selector if module is enabled // Only show price mode and expression selector if module is enabled
if (! empty($conf->dynamicprices->enabled)) { if (! empty($conf->dynamicprices->enabled)) {
// Price mode selector // Price mode selector
print '<tr><td>'.$langs->trans("PriceMode").'</td><td>'; print '<tr><td>'.$langs->trans("PriceMode").'</td><td colspan="2">';
$price_expression = new PriceExpression($db); $price_expression = new PriceExpression($db);
$price_expression_list = array(0 => $langs->trans("PriceNumeric")); //Put the numeric mode as first option $price_expression_list = array(0 => $langs->trans("PriceNumeric")); //Put the numeric mode as first option
foreach ($price_expression->list_price_expression() as $entry) { foreach ($price_expression->list_price_expression() as $entry) {
@ -835,17 +834,18 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
print $form->selectarray('eid', $price_expression_list, $price_expression_preselection); print $form->selectarray('eid', $price_expression_list, $price_expression_preselection);
print '&nbsp; <div id="expression_editor" class="button">'.$langs->trans("PriceExpressionEditor").'</div>'; print '&nbsp; <div id="expression_editor" class="button">'.$langs->trans("PriceExpressionEditor").'</div>';
print '</td></tr>'; print '</td></tr>';
// This code hides the numeric price input if is not selected, loads the editor page if editor button is pressed // This code hides the numeric price input if is not selected, loads the editor page if editor button is pressed
print '<script type="text/javascript"> ?>
jQuery(document).ready(run);
function run() { <script type="text/javascript">
jQuery("#expression_editor").click(on_click); jQuery(document).ready(function() {
jQuery("#expression_editor").click(function() {
window.location = "<?php echo DOL_URL_ROOT ?>/product/dynamic_price/editor.php?id=<?php echo $id ?>&tab=price&eid=" + $("#eid").attr("value");
});
jQuery("#eid").change(on_change); jQuery("#eid").change(on_change);
on_change(); on_change();
} });
function on_click() {
window.location = "'.DOL_URL_ROOT.'/product/dynamic_price/editor.php?id='.$id.'&tab=price&eid=" + $("#eid").attr("value");
}
function on_change() { function on_change() {
if ($("#eid").attr("value") == 0) { if ($("#eid").attr("value") == 0) {
jQuery("#price_numeric").show(); jQuery("#price_numeric").show();
@ -853,7 +853,8 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
jQuery("#price_numeric").hide(); jQuery("#price_numeric").hide();
} }
} }
</script>'; </script>
<?php
} }
// Price // Price
@ -862,7 +863,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
print '<tr id="price_numeric"><td width="20%">'; print '<tr id="price_numeric"><td width="20%">';
$text = $langs->trans('SellingPrice'); $text = $langs->trans('SellingPrice');
print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1); print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1);
print '</td><td>'; print '</td><td colspan="2">';
if ($object->price_base_type == 'TTC') { if ($object->price_base_type == 'TTC') {
print '<input name="price" size="10" value="' . price($product->price_ttc) . '">'; print '<input name="price" size="10" value="' . price($product->price_ttc) . '">';
} else { } else {
@ -874,16 +875,22 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
print '<tr><td>'; print '<tr><td>';
$text = $langs->trans('MinPrice'); $text = $langs->trans('MinPrice');
print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1); print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1);
if ($object->price_base_type == 'TTC') { print '</td><td';
print '<td><input name="price_min" size="10" value="' . price($object->price_min_ttc) . '">'; if (empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) {
} else { print ' colspan="2"';
print '<td><input name="price_min" size="10" value="' . price($object->price_min) . '">';
} }
print '>';
if ($object->price_base_type == 'TTC') {
print '<input name="price_min" size="10" value="' . price($object->price_min_ttc) . '">';
} else {
print '<input name="price_min" size="10" value="' . price($object->price_min) . '">';
}
print '</td>';
if ( !empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) if ( !empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE))
{ {
print '<td align="left">'.$langs->trans("MinimumRecommendedPrice", price($maxpricesupplier,0,'',1,-1,-1,'auto')).' '.img_warning().'</td>'; print '<td align="left">'.$langs->trans("MinimumRecommendedPrice", price($maxpricesupplier,0,'',1,-1,-1,'auto')).' '.img_warning().'</td>';
} }
print '</td></tr>'; print '</tr>';
print '</table>'; print '</table>';
@ -906,8 +913,8 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
<script> <script>
var showHidePriceRules = function () { var showHidePriceRules = function () {
var otherPrices = $('div.fiche form table:not(:first), div.fiche form table:first tr:not(:first)'); var otherPrices = $('div.fiche form table tbody tr:not(:first)');
var minPrice1 = $('div.fiche form:first tr:eq(1)'); var minPrice1 = $('div.fiche form input[name="price_min[1]"]');
if (jQuery('input#usePriceRules').prop('checked')) { if (jQuery('input#usePriceRules').prop('checked')) {
otherPrices.hide(); otherPrices.hide();
@ -927,65 +934,72 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
<?php <?php
print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">'; print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">';
for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++)
{
if ($i > 1) print '<br>';
elseif (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($conf->global->PRODUIT_MULTIPRICES_ALLOW_AUTOCALC_PRICELEVEL)) {
print $langs->trans('UseMultipriceRules'). ' <input type="checkbox" id="usePriceRules" name="usePriceRules" '.($object->price_autogen ? 'checked' : '').'><br><br>';
}
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="update_price">'; print '<input type="hidden" name="action" value="update_price">';
print '<input type="hidden" name="id" value="' . $object->id . '">'; print '<input type="hidden" name="id" value="' . $object->id . '">';
if (empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL))
{ if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($conf->global->PRODUIT_MULTIPRICES_ALLOW_AUTOCALC_PRICELEVEL)) {
print '<input type="hidden" name="tva_tx[' . $i . ']" value="' . $object->tva_tx . '">'; print $langs->trans('UseMultipriceRules'). ' <input type="checkbox" id="usePriceRules" name="usePriceRules" '.($object->price_autogen ? 'checked' : '').'><br><br>';
} }
print '<table class="border" width="100%">'; print '<table class="noborder">';
print '<thead><tr class="liste_titre">
<td style="text-align: center">'.$langs->trans("PriceLevel").'</td>';
if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) {
print '<td style="text-align: center">'.$langs->trans("VATRate").'</td>';
}
print '<td style="text-align: center">'.$langs->trans("SellingPrice").'</td>
<td style="text-align: center">'.$langs->trans("MinPrice").'</td>';
if (!empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) {
print '<td></td>';
}
print '</tr></thead><tbody>';
for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) {
$var = !$var;
print '<tr '.$bc[$var].'>';
print '<td>';
print $form->textwithpicto($langs->trans('SellingPrice') . ' ' . $i, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1);
print '</td>';
// VAT // VAT
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // This option is kept for backward compatibility but has no sense if (empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) {
{ print '<input type="hidden" name="tva_tx[' . $i . ']" value="' . $object->tva_tx . '">';
print '<tr><td>' . $langs->trans("VATRate") . '</td><td>'; } else {
// This option is kept for backward compatibility but has no sense
print '<td style="text-align: center">';
print $form->load_tva("tva_tx[" . $i.']', $object->multiprices_tva_tx[$i], $mysoc, '', $object->id); print $form->load_tva("tva_tx[" . $i.']', $object->multiprices_tva_tx[$i], $mysoc, '', $object->id);
print '</td></tr>'; print '</td>';
} }
// Selling price // Selling price
print '<tr><td width="20%">'; print '<td style="text-align: center">';
$text = $langs->trans('SellingPrice') . ' ' . $i;
print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1);
print '</td><td>';
if ($object->multiprices_base_type [$i] == 'TTC') { if ($object->multiprices_base_type [$i] == 'TTC') {
print '<input name="price[' . $i . ']" size="10" value="' . price($object->multiprices_ttc [$i]) . '">'; print '<input name="price[' . $i . ']" size="10" value="' . price($object->multiprices_ttc [$i]) . '">';
} else { } else {
print '<input name="price[' . $i . ']" size="10" value="' . price($object->multiprices [$i]) . '">'; print '<input name="price[' . $i . ']" size="10" value="' . price($object->multiprices [$i]) . '">';
} }
print '&nbsp;'.$form->selectPriceBaseType($object->multiprices_base_type [$i], "multiprices_base_type[" . $i."]"); print '&nbsp;'.$form->selectPriceBaseType($object->multiprices_base_type [$i], "multiprices_base_type[" . $i."]");
print '</td></tr>'; print '</td>';
// Min price // Min price
print '<tr><td>'; print '<td style="text-align: center">';
$text = $langs->trans('MinPrice') . ' ' . $i;
print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1);
if ($object->multiprices_base_type [$i] == 'TTC') { if ($object->multiprices_base_type [$i] == 'TTC') {
print '<td><input name="price_min[' . $i . ']" size="10" value="' . price($object->multiprices_min_ttc [$i]) . '">'; print '<input name="price_min[' . $i . ']" size="10" value="' . price($object->multiprices_min_ttc [$i]) . '">';
} else { } else {
print '<td><input name="price_min[' . $i . ']" size="10" value="' . price($object->multiprices_min [$i]) . '">'; print '<input name="price_min[' . $i . ']" size="10" value="' . price($object->multiprices_min [$i]) . '">';
} }
if ( !empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) if ( !empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE))
{ {
print '<td align="left">'.$langs->trans("MinimumRecommendedPrice", price($maxpricesupplier,0,'',1,-1,-1,'auto')).' '.img_warning().'</td>'; print '<td align="left">'.$langs->trans("MinimumRecommendedPrice", price($maxpricesupplier,0,'',1,-1,-1,'auto')).' '.img_warning().'</td>';
} }
print '</td></tr>'; print '</td>';
print '</table>';
print '</tr>';
} }
print '<br><div style="text-align: center">'; print '</tbody></table><br><div style="text-align: center">';
print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">'; print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">';
print '&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';

View File

@ -2138,6 +2138,14 @@ else
print '<tr><td>'.$langs->trans("ThirdPartyType").'</td><td>'.$object->typent.'</td>'; print '<tr><td>'.$langs->trans("ThirdPartyType").'</td><td>'.$object->typent.'</td>';
print '<tr><td>'.$langs->trans("Staff").'</td><td>'.$object->effectif.'</td></tr>'; print '<tr><td>'.$langs->trans("Staff").'</td><td>'.$object->effectif.'</td></tr>';
print '</table>';
print '</div>';
print '<div class="fichehalfright"><div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">';
// Legal // Legal
print '<tr><td>'.$langs->trans('JuridicalStatus').'</td><td>'.$object->forme_juridique.'</td></tr>'; print '<tr><td>'.$langs->trans('JuridicalStatus').'</td><td>'.$object->forme_juridique.'</td></tr>';
@ -2147,14 +2155,6 @@ else
else print '&nbsp;'; else print '&nbsp;';
print '</td></tr>'; print '</td></tr>';
print '</table>';
print '</div>';
print '<div class="fichehalfright"><div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">';
// Default language // Default language
if (! empty($conf->global->MAIN_MULTILANGS)) if (! empty($conf->global->MAIN_MULTILANGS))
{ {

View File

@ -232,7 +232,7 @@ body {
<?php } else { ?> <?php } else { ?>
background: rgb(<?php print $colorbackbody; ?>); background: rgb(<?php print $colorbackbody; ?>);
<?php } ?> <?php } ?>
color: #101010; color: rgb(<?php echo $colortext; ?>);
font-size: <?php print $fontsize ?>px; font-size: <?php print $fontsize ?>px;
font-family: <?php print $fontlist ?>; font-family: <?php print $fontlist ?>;
margin-top: 0; margin-top: 0;
@ -3595,6 +3595,9 @@ a span.select2-chosen
overflow: hidden; overflow: hidden;
} }
.noborderoncategories {
border: none !important;
}
/* ============================================================================== */ /* ============================================================================== */
/* Multiselect with checkbox */ /* Multiselect with checkbox */

View File

@ -331,9 +331,9 @@ if ($result)
print '<td class="nowrap">'.img_object('',$picto).' '.$objMod->getName(); print '<td class="nowrap">'.img_object('',$picto).' '.$objMod->getName();
print '<a name="'.$objMod->getName().'">&nbsp;</a></td>'; print '<a name="'.$objMod->getName().'">&nbsp;</a></td>';
print '<td align="center" class="nowrap">'; print '<td align="center" class="nowrap">';
print '<a title="'.dol_escape_htmltag($langs->trans("All")).'" alt="'.dol_escape_htmltag($langs->trans("All")).'" href="perms.php?id='.$object->id.'&amp;action=addrights&amp;entity='.$entity.'&amp;module='.$obj->module.'#'.$objMod->getName().'">'.$langs->trans("All")."</a>"; print '<a class="reposition" title="'.dol_escape_htmltag($langs->trans("All")).'" alt="'.dol_escape_htmltag($langs->trans("All")).'" href="perms.php?id='.$object->id.'&amp;action=addrights&amp;entity='.$entity.'&amp;module='.$obj->module.'">'.$langs->trans("All")."</a>";
print '/'; print '/';
print '<a title="'.dol_escape_htmltag($langs->trans("None")).'" alt="'.dol_escape_htmltag($langs->trans("None")).'" href="perms.php?id='.$object->id.'&amp;action=delrights&amp;entity='.$entity.'&amp;module='.$obj->module.'#'.$objMod->getName().'">'.$langs->trans("None")."</a>"; print '<a class="reposition" title="'.dol_escape_htmltag($langs->trans("None")).'" alt="'.dol_escape_htmltag($langs->trans("None")).'" href="perms.php?id='.$object->id.'&amp;action=delrights&amp;entity='.$entity.'&amp;module='.$obj->module.'">'.$langs->trans("None")."</a>";
print '</td>'; print '</td>';
print '<td colspan="2">&nbsp;</td>'; print '<td colspan="2">&nbsp;</td>';
print '</tr>'."\n"; print '</tr>'."\n";
@ -360,7 +360,7 @@ if ($result)
{ {
if ($caneditperms) if ($caneditperms)
{ {
print '<td align="center"><a href="perms.php?id='.$object->id.'&amp;action=delrights&amp;rights='.$obj->id.'#'.$objMod->getName().'">'.img_edit_remove($langs->trans("Remove")).'</a></td>'; print '<td align="center"><a class="reposition" href="perms.php?id='.$object->id.'&amp;action=delrights&amp;rights='.$obj->id.'">'.img_edit_remove($langs->trans("Remove")).'</a></td>';
} }
print '<td align="center" class="nowrap">'; print '<td align="center" class="nowrap">';
print img_picto($langs->trans("Active"),'tick'); print img_picto($langs->trans("Active"),'tick');
@ -386,7 +386,7 @@ if ($result)
// Do not own permission // Do not own permission
if ($caneditperms) if ($caneditperms)
{ {
print '<td align="center"><a href="perms.php?id='.$object->id.'&amp;action=addrights&amp;entity='.$entity.'&amp;rights='.$obj->id.'#'.$objMod->getName().'">'.img_edit_add($langs->trans("Add")).'</a></td>'; print '<td align="center"><a class="reposition" href="perms.php?id='.$object->id.'&amp;action=addrights&amp;entity='.$entity.'&amp;rights='.$obj->id.'">'.img_edit_add($langs->trans("Add")).'</a></td>';
} }
print '<td>&nbsp</td>'; print '<td>&nbsp</td>';
} }
@ -396,7 +396,7 @@ if ($result)
// Do not own permission // Do not own permission
if ($caneditperms) if ($caneditperms)
{ {
print '<td align="center"><a href="perms.php?id='.$object->id.'&amp;action=addrights&amp;entity='.$entity.'&amp;rights='.$obj->id.'#'.$objMod->getName().'">'.img_edit_add($langs->trans("Add")).'</a></td>'; print '<td align="center"><a class="reposition" href="perms.php?id='.$object->id.'&amp;action=addrights&amp;entity='.$entity.'&amp;rights='.$obj->id.'">'.img_edit_add($langs->trans("Add")).'</a></td>';
} }
print '<td>&nbsp</td>'; print '<td>&nbsp</td>';
} }