Merge branch '16.0' of github.com:Dolibarr/dolibarr into 16.0_FIX_getunitFromCode_AddFilterType
This commit is contained in:
commit
7ff40f5f16
@ -169,6 +169,16 @@ class BookKeeping extends CommonObject
|
||||
*/
|
||||
public $piece_num;
|
||||
|
||||
/**
|
||||
* @var integer|string date of movement validated & lock
|
||||
*/
|
||||
public $date_validation;
|
||||
|
||||
/**
|
||||
* @var integer|string date of movement who are noticed like exported
|
||||
*/
|
||||
public $date_export;
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
*/
|
||||
@ -788,8 +798,7 @@ class BookKeeping extends CommonObject
|
||||
$this->piece_num = $obj->piece_num;
|
||||
$this->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$this->date_export = $this->db->jdate($obj->date_export);
|
||||
$this->date_validation = $this->db->jdate($obj->date_validated);
|
||||
$this->date_validation = $this->db->jdate($obj->date_validation);
|
||||
$this->date_validation = isset($obj->date_validated) ? $this->db->jdate($obj->date_validated) : '';
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
|
||||
@ -294,9 +294,7 @@ if ($action == 'writebookkeeping') {
|
||||
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
||||
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
||||
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
||||
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
||||
$companystatic->fournisseur = 1;
|
||||
|
||||
@ -626,9 +624,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
foreach ($tabfac as $key => $val) {
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
||||
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
||||
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
||||
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
||||
$companystatic->fournisseur = 1;
|
||||
|
||||
@ -757,7 +753,7 @@ if (empty($action) || $action == 'view') {
|
||||
$periodlink = '';
|
||||
$exportlink = '';
|
||||
$builddate = dol_now();
|
||||
$description .= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
||||
$description = $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$description .= $langs->trans("DepositsAreNotIncluded");
|
||||
} else {
|
||||
@ -837,9 +833,7 @@ if (empty($action) || $action == 'view') {
|
||||
foreach ($tabfac as $key => $val) {
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
||||
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
||||
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
||||
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
||||
$companystatic->fournisseur = 1;
|
||||
|
||||
|
||||
@ -310,9 +310,7 @@ if ($action == 'writebookkeeping') {
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
||||
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
||||
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
||||
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
||||
$companystatic->client = 3;
|
||||
|
||||
$invoicestatic->id = $key;
|
||||
@ -600,9 +598,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
||||
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
||||
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
||||
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
||||
$companystatic->client = 3;
|
||||
|
||||
$invoicestatic->id = $key;
|
||||
@ -790,9 +786,7 @@ if (empty($action) || $action == 'view') {
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
||||
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
||||
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
||||
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
||||
$companystatic->client = 3;
|
||||
|
||||
$invoicestatic->id = $key;
|
||||
|
||||
@ -142,7 +142,7 @@ if (!function_exists("ldap_connect")) {
|
||||
print dol_get_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"), -1);
|
||||
|
||||
|
||||
print $langs->trans("LDAPDescContact").'<br>';
|
||||
print '<span class="opacitymedium">'.$langs->trans("LDAPDescContact").'</span><br>';
|
||||
print '<br>';
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newToken().'">';
|
||||
|
||||
@ -116,7 +116,7 @@ if (!function_exists("ldap_connect")) {
|
||||
print dol_get_fiche_head($head, 'groups', $langs->trans("LDAPSetup"), -1);
|
||||
|
||||
|
||||
print $langs->trans("LDAPDescGroups").'<br>';
|
||||
print '<span class="opacitymedium">'.$langs->trans("LDAPDescGroups").'</span><br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
@ -190,7 +190,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print dol_get_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1);
|
||||
|
||||
|
||||
print $langs->trans("LDAPDescMembers").'<br>';
|
||||
print '<span class="opacitymedium">'.$langs->trans("LDAPDescMembers").'</span><br>';
|
||||
print '<br>';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
@ -108,7 +108,7 @@ if (!function_exists("ldap_connect")) {
|
||||
print dol_get_fiche_head($head, 'memberstypes', $langs->trans("LDAPSetup"), -1);
|
||||
|
||||
|
||||
print $langs->trans("LDAPDescMembersTypes").'<br>';
|
||||
print '<span class="opacitymedium">'.$langs->trans("LDAPDescMembersTypes").'</span><br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
@ -179,7 +179,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
print dol_get_fiche_head($head, 'users', $langs->trans("LDAPSetup"), -1);
|
||||
|
||||
print $langs->trans("LDAPDescUsers").'<br>';
|
||||
print '<span class="opacitymedium">'.$langs->trans("LDAPDescUsers").'</span><br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai
|
||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('admin', 'oauth'));
|
||||
$langs->loadLangs(array('admin', 'oauth', 'modulebuilder'));
|
||||
|
||||
// Security check
|
||||
if (!$user->admin) {
|
||||
@ -100,7 +100,7 @@ $form = new Form($db);
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans('ConfigOAuth'), $linkback, 'title_setup');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
@ -130,22 +130,15 @@ foreach ($list as $key) {
|
||||
}
|
||||
print '</select>';
|
||||
print ajax_combobox('provider');
|
||||
print ' <input type="text" name="label" value="" placeholder="'.$langs->trans("Label").'">';
|
||||
print ' <input type="text" name="label" value="" placeholder="'.$langs->trans("Label").'" pattern="^\S+$" title="'.$langs->trans("SpaceOrSpecialCharAreNotAllowed").'">';
|
||||
print ' <input type="submit" class="button small" name="add" value="'.$langs->trans("Add").'">';
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
$i = 0;
|
||||
|
||||
//var_dump($list);
|
||||
foreach ($conf->global as $key => $val) {
|
||||
@ -155,83 +148,93 @@ foreach ($conf->global as $key => $val) {
|
||||
}
|
||||
}
|
||||
|
||||
// $list is defined into oauth.lib.php to the list of supporter OAuth providers.
|
||||
foreach ($listinsetup as $key) {
|
||||
$supported = 0;
|
||||
$keyforsupportedoauth2array = $key[0]; // May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME
|
||||
$keyforsupportedoauth2array = preg_replace('/^OAUTH_/', '', $keyforsupportedoauth2array);
|
||||
$keyforsupportedoauth2array = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array);
|
||||
if (preg_match('/^.*-/', $keyforsupportedoauth2array)) {
|
||||
$keyforprovider = preg_replace('/^.*-/', '', $keyforsupportedoauth2array);
|
||||
} else {
|
||||
$keyforprovider = '';
|
||||
}
|
||||
$keyforsupportedoauth2array = preg_replace('/-.*$/', '', $keyforsupportedoauth2array);
|
||||
$keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME';
|
||||
|
||||
if (in_array($keyforsupportedoauth2array, array_keys($supportedoauth2array))) {
|
||||
$supported = 1;
|
||||
}
|
||||
if (!$supported) {
|
||||
continue; // show only supported
|
||||
}
|
||||
if (count($listinsetup) > 0) {
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
$i++;
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre'.($i > 1 ? ' liste_titre_add' : '').'">';
|
||||
// Api Name
|
||||
$label = $langs->trans($keyforsupportedoauth2array);
|
||||
print '<td>';
|
||||
print img_picto('', $supportedoauth2array[$keyforsupportedoauth2array]['picto'], 'class="pictofixedwidth"');
|
||||
print $label;
|
||||
if ($keyforprovider) {
|
||||
print ' (<b>'.$keyforprovider.'</b>)';
|
||||
} else {
|
||||
print ' (<b>'.$langs->trans("NoName").'</b>)';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (!empty($supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials'])) {
|
||||
print $langs->trans("OAUTH_URL_FOR_CREDENTIAL", $supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials']);
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
$i = 0;
|
||||
|
||||
if ($supported) {
|
||||
$redirect_uri = $urlwithroot.'/core/modules/oauth/'.$supportedoauth2array[$keyforsupportedoauth2array]['callbackfile'].'_oauthcallback.php';
|
||||
// $list is defined into oauth.lib.php to the list of supporter OAuth providers.
|
||||
foreach ($listinsetup as $key) {
|
||||
$supported = 0;
|
||||
$keyforsupportedoauth2array = $key[0]; // May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME
|
||||
$keyforsupportedoauth2array = preg_replace('/^OAUTH_/', '', $keyforsupportedoauth2array);
|
||||
$keyforsupportedoauth2array = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array);
|
||||
if (preg_match('/^.*-/', $keyforsupportedoauth2array)) {
|
||||
$keyforprovider = preg_replace('/^.*-/', '', $keyforsupportedoauth2array);
|
||||
} else {
|
||||
$keyforprovider = '';
|
||||
}
|
||||
$keyforsupportedoauth2array = preg_replace('/-.*$/', '', $keyforsupportedoauth2array);
|
||||
$keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME';
|
||||
|
||||
if (in_array($keyforsupportedoauth2array, array_keys($supportedoauth2array))) {
|
||||
$supported = 1;
|
||||
}
|
||||
if (!$supported) {
|
||||
continue; // show only supported
|
||||
}
|
||||
|
||||
$i++;
|
||||
|
||||
print '<tr class="liste_titre'.($i > 1 ? ' liste_titre_add' : '').'">';
|
||||
// Api Name
|
||||
$label = $langs->trans($keyforsupportedoauth2array);
|
||||
print '<td>';
|
||||
print img_picto('', $supportedoauth2array[$keyforsupportedoauth2array]['picto'], 'class="pictofixedwidth"');
|
||||
print $label;
|
||||
if ($keyforprovider) {
|
||||
print ' (<b>'.$keyforprovider.'</b>)';
|
||||
} else {
|
||||
print ' (<b>'.$langs->trans("NoName").'</b>)';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (!empty($supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials'])) {
|
||||
print $langs->trans("OAUTH_URL_FOR_CREDENTIAL", $supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials']);
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($supported) {
|
||||
$redirect_uri = $urlwithroot.'/core/modules/oauth/'.$supportedoauth2array[$keyforsupportedoauth2array]['callbackfile'].'_oauthcallback.php';
|
||||
print '<tr class="oddeven value">';
|
||||
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
|
||||
print '<td><input style="width: 80%" type"text" name="uri'.$keyforsupportedoauth2array.'" value="'.$redirect_uri.'">';
|
||||
print '</td></tr>';
|
||||
} else {
|
||||
print '<tr class="oddeven value">';
|
||||
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
|
||||
print '<td>'.$langs->trans("FeatureNotYetSupported").'</td>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Api Id
|
||||
print '<tr class="oddeven value">';
|
||||
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
|
||||
print '<td><input style="width: 80%" type"text" name="uri'.$keyforsupportedoauth2array.'" value="'.$redirect_uri.'">';
|
||||
print '<td><label for="'.$key[1].'">'.$langs->trans("OAUTH_ID").'</label></td>';
|
||||
print '<td><input type="text" size="100" id="'.$key[1].'" name="'.$key[1].'" value="'.$conf->global->{$key[1]}.'">';
|
||||
print '</td></tr>';
|
||||
} else {
|
||||
|
||||
// Api Secret
|
||||
print '<tr class="oddeven value">';
|
||||
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
|
||||
print '<td>'.$langs->trans("FeatureNotYetSupported").'</td>';
|
||||
print '<td><label for="'.$key[2].'">'.$langs->trans("OAUTH_SECRET").'</label></td>';
|
||||
print '<td><input type="password" size="100" id="'.$key[2].'" name="'.$key[2].'" value="'.$conf->global->{$key[2]}.'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Api Id
|
||||
print '<tr class="oddeven value">';
|
||||
print '<td><label for="'.$key[1].'">'.$langs->trans("OAUTH_ID").'</label></td>';
|
||||
print '<td><input type="text" size="100" id="'.$key[1].'" name="'.$key[1].'" value="'.$conf->global->{$key[1]}.'">';
|
||||
print '</td></tr>';
|
||||
print '</table>'."\n";
|
||||
print '</div>';
|
||||
|
||||
// Api Secret
|
||||
print '<tr class="oddeven value">';
|
||||
print '<td><label for="'.$key[2].'">'.$langs->trans("OAUTH_SECRET").'</label></td>';
|
||||
print '<td><input type="password" size="100" id="'.$key[2].'" name="'.$key[2].'" value="'.$conf->global->{$key[2]}.'">';
|
||||
print '</td></tr>';
|
||||
print $form->buttonsSaveCancel("Modify", '');
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print $form->buttonsSaveCancel("Modify", '');
|
||||
|
||||
print '</form>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("install", "other", "admin"));
|
||||
$langs->loadLangs(array("install", "other", "admin", "products"));
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
|
||||
@ -1028,10 +1028,20 @@ class BOM extends CommonObject
|
||||
*/
|
||||
public function calculateCosts()
|
||||
{
|
||||
global $hookmanager;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
$this->unit_cost = 0;
|
||||
$this->total_cost = 0;
|
||||
|
||||
$parameters=array();
|
||||
$reshook = $hookmanager->executeHooks('calculateCostsBom', $parameters, $this); // Note that $action and $object may have been modified by hook
|
||||
|
||||
|
||||
if ($reshook > 0) {
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
if (is_array($this->lines) && count($this->lines)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
$productFournisseur = new ProductFournisseur($this->db);
|
||||
|
||||
@ -42,8 +42,12 @@ function printDropdownBookmarksList()
|
||||
if (!empty($_SERVER["QUERY_STRING"])) {
|
||||
if (is_array($_GET)) {
|
||||
foreach ($_GET as $key => $val) {
|
||||
if ($val != '') {
|
||||
$url_param[$key]=http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val)));
|
||||
if (is_array($val)) {
|
||||
foreach ($val as $tmpsubval) {
|
||||
$url_param[] = http_build_query(array(dol_escape_htmltag($key).'[]' => dol_escape_htmltag($tmpsubval)));
|
||||
}
|
||||
} elseif ($val != '') {
|
||||
$url_param[$key] = http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -61,10 +65,11 @@ function printDropdownBookmarksList()
|
||||
if ((preg_match('/^search_/', $key) || in_array($key, $authorized_var))
|
||||
&& $val != ''
|
||||
&& !array_key_exists($key, $url_param)) {
|
||||
$url_param[$key]=http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val)));
|
||||
$url_param[$key] = http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$url .= ($tmpurl ? '?'.$tmpurl : '');
|
||||
if (!empty($url_param)) {
|
||||
$url .= '&'.implode('&', $url_param);
|
||||
|
||||
@ -1265,7 +1265,7 @@ class Propal extends CommonObject
|
||||
break;
|
||||
}
|
||||
// Defined the new fk_parent_line
|
||||
if ($result > 0) {
|
||||
if ($result > 0 && $line->product_type == 9) {
|
||||
$fk_parent_line = $result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -424,7 +424,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Defined the new fk_parent_line
|
||||
if ($result > 0) {
|
||||
if ($result > 0 && $lines[$i]->product_type == 9) {
|
||||
$fk_parent_line = $result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1073,7 +1073,7 @@ class Commande extends CommonOrder
|
||||
return -1;
|
||||
}
|
||||
// Defined the new fk_parent_line
|
||||
if ($result > 0) {
|
||||
if ($result > 0 && $line->product_type == 9) {
|
||||
$fk_parent_line = $result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1244,7 +1244,7 @@ if (empty($reshook)) {
|
||||
$object->lines[] = $line; // insert new line in current object
|
||||
|
||||
// Defined the new fk_parent_line
|
||||
if ($result > 0) {
|
||||
if ($result > 0 && $line->product_type == 9) {
|
||||
$fk_parent_line = $result;
|
||||
}
|
||||
}
|
||||
@ -1765,7 +1765,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Defined the new fk_parent_line
|
||||
if ($result > 0) {
|
||||
if ($result > 0 && $lines[$i]->product_type == 9) {
|
||||
$fk_parent_line = $result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -872,7 +872,7 @@ class Facture extends CommonInvoice
|
||||
);
|
||||
|
||||
// Defined the new fk_parent_line
|
||||
if ($result > 0) {
|
||||
if ($result > 0 && $newinvoiceline->product_type == 9) {
|
||||
$fk_parent_line = $result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -451,7 +451,8 @@ if (!empty($arrayfields['p.ref']['checked'])) {
|
||||
if (!empty($arrayfields['cs.fk_user']['checked'])) {
|
||||
// Employee
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_dolusers($search_users, 'search_users', 1, null, 0, '', '', '0', '0', 0, '', 0, '', '', 0, 0, true);
|
||||
print $form->select_dolusers($search_users, 'search_users', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth150', 0, 0, true);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Filter: Type
|
||||
@ -592,7 +593,7 @@ while ($i < min($num, $limit)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
$typelabelpopup .= ' - '.$langs->trans("AccountancyCode").': '.$obj->type_accountancy_code;
|
||||
}
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($typelabelpopup).'">'.dol_escape_htmltag($typelabeltoshow).'</td>';
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($typelabelpopup).'">'.dol_escape_htmltag($typelabeltoshow).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -600,7 +601,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Date
|
||||
if (!empty($arrayfields['cs.date_ech']['checked'])) {
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->date_ech), 'day').'</td>';
|
||||
print '<td class="center nowraponall">'.dol_print_date($db->jdate($obj->date_ech), 'day').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -608,7 +609,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Date end period
|
||||
if (!empty($arrayfields['cs.periode']['checked'])) {
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->periode), 'day').'</td>';
|
||||
print '<td class="center nowraponall">'.dol_print_date($db->jdate($obj->periode), 'day').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -616,7 +617,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Project ref
|
||||
if (!empty($arrayfields['p.ref']['checked'])) {
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="nowraponall">';
|
||||
if ($obj->project_id > 0) {
|
||||
print $projectstatic->getNomUrl(1);
|
||||
}
|
||||
@ -628,7 +629,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
if (!empty($arrayfields['cs.fk_user']['checked'])) {
|
||||
// Employee
|
||||
print "<td>";
|
||||
print '<td class="tdoverflowmax150">';
|
||||
if (!empty($obj->fk_user)) {
|
||||
if (!empty($TLoadedUsers[$obj->fk_user])) {
|
||||
$ustatic = $TLoadedUsers[$obj->fk_user];
|
||||
@ -647,7 +648,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Type
|
||||
if (!empty($arrayfields['cs.fk_mode_reglement']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans("PaymentTypeShort".$obj->payment_code)).'">';
|
||||
if (!empty($obj->payment_code)) {
|
||||
print $langs->trans("PaymentTypeShort".$obj->payment_code);
|
||||
}
|
||||
@ -659,7 +660,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Account
|
||||
if (!empty($arrayfields['cs.fk_account']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="toverflowmax150">';
|
||||
if ($obj->fk_account > 0) {
|
||||
$bankstatic->id = $obj->fk_account;
|
||||
$bankstatic->ref = $obj->bref;
|
||||
@ -682,7 +683,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Amount
|
||||
if (!empty($arrayfields['cs.amount']['checked'])) {
|
||||
print '<td class="nowrap amount right">'.price($obj->amount).'</td>';
|
||||
print '<td class="nowraponall amount right">'.price($obj->amount).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -694,7 +695,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Status
|
||||
if (!empty($arrayfields['cs.paye']['checked'])) {
|
||||
print '<td class="nowrap right">'.$chargesociale_static->LibStatut($obj->paye, 5, $obj->alreadypayed).'</td>';
|
||||
print '<td class="nowraponall right">'.$chargesociale_static->LibStatut($obj->paye, 5, $obj->alreadypayed).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -269,8 +269,8 @@ if ($result) {
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
$cum_ht[$obj->dm] = !empty($obj->amount) ? $obj->amount : 0;
|
||||
$cum[$obj->dm] = $obj->amount_ttc;
|
||||
$cum_ht[$obj->dm] = empty($obj->amount) ? 0 : $obj->amount;
|
||||
$cum[$obj->dm] = empty($obj->amount_ttc) ? 0 : $obj->amount_ttc;
|
||||
if ($obj->amount_ttc) {
|
||||
$minyearmonth = ($minyearmonth ? min($minyearmonth, $obj->dm) : $obj->dm);
|
||||
$maxyearmonth = max($maxyearmonth, $obj->dm);
|
||||
@ -302,7 +302,11 @@ if ($modecompta == 'RECETTES-DEPENSES') {
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
$cum[$obj->dm] += $obj->amount_ttc;
|
||||
if (empty($cum[$obj->dm])) {
|
||||
$cum[$obj->dm] = $obj->amount_ttc;
|
||||
} else {
|
||||
$cum[$obj->dm] += $obj->amount_ttc;
|
||||
}
|
||||
if ($obj->amount_ttc) {
|
||||
$minyearmonth = ($minyearmonth ?min($minyearmonth, $obj->dm) : $obj->dm);
|
||||
$maxyearmonth = max($maxyearmonth, $obj->dm);
|
||||
@ -404,12 +408,6 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) {
|
||||
$case = dol_print_date(dol_mktime(1, 1, 1, $mois_modulo, 1, $annee_decalage), "%Y-%m");
|
||||
$caseprev = dol_print_date(dol_mktime(1, 1, 1, $mois_modulo, 1, $annee_decalage - 1), "%Y-%m");
|
||||
|
||||
$total_ht[$annee]=0;
|
||||
$total[$annee]=0;
|
||||
$cum_ht[$case]=0;
|
||||
$cum[$case]=0;
|
||||
|
||||
|
||||
if ($annee >= $year_start) { // We ignore $annee < $year_start, we loop on it to be able to make delta, nothing is output.
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
// Value turnover of month w/o VAT
|
||||
@ -452,7 +450,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) {
|
||||
print "</td>";
|
||||
|
||||
// Percentage of month
|
||||
print '<td class="borderrightlight right">';
|
||||
print '<td class="borderrightlight right"><span class="opacitymedium">';
|
||||
//var_dump($annee.' '.$year_end.' '.$mois.' '.$month_end);
|
||||
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
|
||||
if ($annee_decalage > $minyear && $case <= $casenow) {
|
||||
@ -482,7 +480,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) {
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '</span></td>';
|
||||
|
||||
if ($annee_decalage < $year_end || ($annee_decalage == $year_end && $mois > 12 && $annee < $year_end)) {
|
||||
print '<td width="15"> </td>';
|
||||
|
||||
@ -5141,6 +5141,12 @@ class Form
|
||||
},';
|
||||
}
|
||||
|
||||
$jsforcursor = '';
|
||||
if (empty($useajax)) {
|
||||
$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
|
||||
$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
|
||||
}
|
||||
|
||||
$formconfirm .= '
|
||||
resizable: false,
|
||||
height: "'.$height.'",
|
||||
@ -5152,7 +5158,8 @@ class Form
|
||||
var options = "&token='.urlencode(newToken()).'";
|
||||
var inputok = '.json_encode($inputok).'; /* List of fields into form */
|
||||
var pageyes = "'.dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
|
||||
if (inputok.length>0) {
|
||||
|
||||
if (inputok.length > 0) {
|
||||
$.each(inputok, function(i, inputname) {
|
||||
var more = "";
|
||||
var inputvalue;
|
||||
@ -5168,14 +5175,18 @@ class Form
|
||||
});
|
||||
}
|
||||
var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options;
|
||||
if (pageyes.length > 0) { location.href = urljump; }
|
||||
$(this).dialog("close");
|
||||
if (pageyes.length > 0) {
|
||||
'.$jsforcursor.'
|
||||
location.href = urljump;
|
||||
console.log("after location.href");
|
||||
}
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"'.dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
|
||||
var options = "&token='.urlencode(newToken()).'";
|
||||
var inputko = '.json_encode($inputko).'; /* List of fields into form */
|
||||
var pageno="'.dol_escape_js(!empty($pageno) ? $pageno : '').'";
|
||||
if (inputko.length>0) {
|
||||
if (inputko.length > 0) {
|
||||
$.each(inputko, function(i, inputname) {
|
||||
var more = "";
|
||||
if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; }
|
||||
@ -5186,7 +5197,11 @@ class Form
|
||||
}
|
||||
var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "") + options;
|
||||
//alert(urljump);
|
||||
if (pageno.length > 0) { location.href = urljump; }
|
||||
if (pageno.length > 0) {
|
||||
'.$jsforcursor.'
|
||||
location.href = urljump;
|
||||
console.log("after location.href");
|
||||
}
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,6 +73,8 @@ class FormTicket
|
||||
public $withfile;
|
||||
public $withfilereadonly;
|
||||
|
||||
public $backtopage;
|
||||
|
||||
public $ispublic; // To show information or not into public form
|
||||
|
||||
public $withtitletopic;
|
||||
@ -1358,6 +1360,7 @@ class FormTicket
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="'.$this->action.'">';
|
||||
print '<input type="hidden" name="actionbis" value="add_message">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$this->backtopage.'">';
|
||||
foreach ($this->param as $key => $value) {
|
||||
print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
|
||||
}
|
||||
|
||||
@ -263,6 +263,7 @@ class Ldap
|
||||
if ($this->result) {
|
||||
$this->bind = $this->result;
|
||||
$connected = 2;
|
||||
$this->connectedServer = $host;
|
||||
break;
|
||||
} else {
|
||||
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||
@ -275,6 +276,7 @@ class Ldap
|
||||
if ($this->result) {
|
||||
$this->bind = $this->result;
|
||||
$connected = 2;
|
||||
$this->connectedServer = $host;
|
||||
break;
|
||||
} else {
|
||||
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||
@ -287,6 +289,7 @@ class Ldap
|
||||
if ($result) {
|
||||
$this->bind = $this->result;
|
||||
$connected = 1;
|
||||
$this->connectedServer = $host;
|
||||
break;
|
||||
} else {
|
||||
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||
@ -297,10 +300,8 @@ class Ldap
|
||||
|
||||
if (!$connected) {
|
||||
$this->unbind();
|
||||
} else {
|
||||
$this->connectedServer = $host;
|
||||
}
|
||||
}
|
||||
} // End loop on each server
|
||||
}
|
||||
|
||||
if ($connected) {
|
||||
|
||||
@ -274,6 +274,9 @@ function getDefaultDatesForTransfer()
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
$pastmonth = 0;
|
||||
$pastmonthyear = 0;
|
||||
|
||||
// Period by default on transfer (0: previous month | 1: current month | 2: fiscal year)
|
||||
$periodbydefaultontransfer = (empty($conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER) ? 0 : $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER);
|
||||
if ($periodbydefaultontransfer == 2) {
|
||||
|
||||
@ -124,7 +124,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes
|
||||
if ($passok) {
|
||||
$login = $obj->login;
|
||||
} else {
|
||||
sleep(2); // Anti brut force protection
|
||||
sleep(1); // Anti brut force protection
|
||||
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO bad password for '".$usertotest."', cryptType=".$cryptType, LOG_NOTICE);
|
||||
|
||||
// Load translation files required by the page
|
||||
|
||||
@ -233,12 +233,14 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
|
||||
|
||||
$usertmp = new User($db);
|
||||
$usertmp->fetch('', $login);
|
||||
$ret = $mc->checkRight($usertmp->id, $entitytotest);
|
||||
if ($ret < 0) {
|
||||
dol_syslog("functions_ldap::check_user_password_ldap Authentication KO entity '".$entitytotest."' not allowed for user id '".$usertmp->id."'", LOG_NOTICE);
|
||||
$login = ''; // force authentication failure
|
||||
if (is_object($mc)) {
|
||||
$ret = $mc->checkRight($usertmp->id, $entitytotest);
|
||||
if ($ret < 0) {
|
||||
dol_syslog("functions_ldap::check_user_password_ldap Authentication KO entity '".$entitytotest."' not allowed for user id '".$usertmp->id."'", LOG_NOTICE);
|
||||
$login = ''; // force authentication failure
|
||||
}
|
||||
unset($usertmp);
|
||||
}
|
||||
unset($usertmp);
|
||||
}
|
||||
}
|
||||
if ($result == 1) {
|
||||
@ -265,7 +267,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
|
||||
$ldap->ldapErrorText = ldap_error($ldap->connection);
|
||||
dol_syslog("functions_ldap::check_user_password_ldap ".$ldap->ldapErrorCode." ".$ldap->ldapErrorText);
|
||||
}
|
||||
sleep(2); // Anti brut force protection
|
||||
sleep(1); // Anti brut force protection
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('main', 'other', 'errors'));
|
||||
|
||||
@ -1269,7 +1269,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
global $langs;
|
||||
|
||||
$langs->loadLangs(array('payment', 'paybox'));
|
||||
$langs->loadLangs(array('payment', 'paybox', 'stripe'));
|
||||
$servicename = $langs->transnoentities('Online');
|
||||
$paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', '');
|
||||
$linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' <a href="'.$paiement_url.'">'.$outputlangs->transnoentities("ClickHere").'</a>';
|
||||
|
||||
@ -101,7 +101,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
|
||||
if ($action == 'edit_extras') {
|
||||
$value = (GETPOSTISSET("options_".$tmpkeyextra) ? GETPOST("options_".$tmpkeyextra) : $object->array_options["options_".$tmpkeyextra]);
|
||||
} else {
|
||||
$value = (!empty($object->array_options["options_".$tmpkeyextra]) ? $object->array_options["options_".$tmpkeyextra] : '');
|
||||
$value = (isset($object->array_options["options_".$tmpkeyextra]) ? $object->array_options["options_".$tmpkeyextra] : '');
|
||||
//var_dump($tmpkeyextra.' - '.$value);
|
||||
}
|
||||
|
||||
|
||||
@ -2054,6 +2054,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
$inventorycode = dol_print_date(dol_now(), 'dayhourlog');
|
||||
|
||||
if (($this->statut == self::STATUS_ORDERSENT || $this->statut == self::STATUS_RECEIVED_PARTIALLY || $this->statut == self::STATUS_RECEIVED_COMPLETELY)) {
|
||||
$this->db->begin();
|
||||
|
||||
@ -2087,12 +2089,14 @@ class CommandeFournisseur extends CommonOrder
|
||||
// $price should take into account discount (except if option STOCK_EXCLUDE_DISCOUNT_FOR_PMP is on)
|
||||
$mouv->origin = &$this;
|
||||
$mouv->setOrigin($this->element, $this->id);
|
||||
|
||||
// Method change if qty < 0
|
||||
if (!empty($conf->global->SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN) && $qty < 0) {
|
||||
$result = $mouv->livraison($user, $product, $entrepot, $qty*(-1), $price, $comment, $now, $eatby, $sellby, $batch);
|
||||
} else {
|
||||
$result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch);
|
||||
$result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch, $inventorycode);
|
||||
}
|
||||
|
||||
if ($result < 0) {
|
||||
$this->error = $mouv->error;
|
||||
$this->errors = $mouv->errors;
|
||||
|
||||
@ -221,6 +221,7 @@ if ($action == 'denydispatchline' && $permissiontocontrol) {
|
||||
|
||||
if ($action == 'dispatch' && $permissiontoreceive) {
|
||||
$error = 0;
|
||||
$notrigger = 0;
|
||||
|
||||
$db->begin();
|
||||
|
||||
|
||||
@ -516,7 +516,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt(
|
||||
$sensitiveget = false;
|
||||
if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) {
|
||||
// All GET actions and mass actions are processed as sensitive.
|
||||
if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'file_manager'))) { // We exclude the case action='create' and action='file_manager' that are legitimate
|
||||
if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'file_manager', 'presend', 'presend_addmessage'))) { // We exclude the case action='create' and action='file_manager' that are legitimate
|
||||
$sensitiveget = true;
|
||||
}
|
||||
} elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) {
|
||||
|
||||
@ -43,8 +43,6 @@ $result = restrictedArea($user, 'societe', '', '');
|
||||
$result = restrictedArea($user, 'margins');
|
||||
|
||||
|
||||
$mesg = '';
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
@ -64,18 +62,18 @@ if (!$sortorder) {
|
||||
}
|
||||
|
||||
$startdate = $enddate = '';
|
||||
|
||||
if (!empty($_POST['startdatemonth'])) {
|
||||
$startdate = dol_mktime(0, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']);
|
||||
if (GETPOST('startdatemonth')) {
|
||||
$startdate = dol_mktime(0, 0, 0, GETPOST('startdatemonth', 'int'), GETPOST('startdateday', 'int'), GETPOST('startdateyear', 'int'));
|
||||
}
|
||||
if (!empty($_POST['enddatemonth'])) {
|
||||
$enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
|
||||
if (GETPOST('enddatemonth')) {
|
||||
$enddate = dol_mktime(23, 59, 59, GETPOST('enddatemonth', 'int'), GETPOST('enddateday', 'int'), GETPOST('enddateyear'));
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new Societe($db);
|
||||
$hookmanager->initHooks(array('margincustomerlist'));
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -188,7 +186,7 @@ print '<table class="border centpercent">';
|
||||
|
||||
// Total Margin
|
||||
print '<tr><td class="titlefield">'.$langs->trans("TotalMargin").'</td><td colspan="4">';
|
||||
print '<span id="totalMargin"></span>'; // set by jquery (see below)
|
||||
print '<span id="totalMargin" class="amount"></span> <span class="amount">'.$langs->getCurrencySymbol($conf->currency).'</span>'; // set by jquery (see below)
|
||||
print '</td></tr>';
|
||||
|
||||
// Margin Rate
|
||||
@ -271,6 +269,30 @@ $sql .= $db->order($sortfield, $sortorder);
|
||||
// TODO: calculate total to display then restore pagination
|
||||
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||
|
||||
$param = '&socid='.((int) $socid);
|
||||
if (GETPOST('startdatemonth', 'int')) {
|
||||
$param .= '&startdateyear='.GETPOST('startdateyear', 'int');
|
||||
$param .= '&startdatemonth='.GETPOST('startdatemonth', 'int');
|
||||
$param .= '&startdateday='.GETPOST('startdateday', 'int');
|
||||
}
|
||||
if (GETPOST('enddatemonth', 'int')) {
|
||||
$param .= '&enddateyear='.GETPOST('enddateyear', 'int');
|
||||
$param .= '&enddatemonth='.GETPOST('enddatemonth', 'int');
|
||||
$param .= '&enddateday='.GETPOST('enddateday', 'int');
|
||||
}
|
||||
$listofproducts = GETPOST('products', 'array:int');
|
||||
if (is_array($listofproducts)) {
|
||||
foreach ($listofproducts as $val) {
|
||||
$param .= '&products[]='.$val;
|
||||
}
|
||||
}
|
||||
$listofcateg = GETPOST('categories', 'array:int');
|
||||
if (is_array($listofcateg)) {
|
||||
foreach ($listofcateg as $val) {
|
||||
$param .= '&categories[]='.$val;
|
||||
}
|
||||
}
|
||||
|
||||
dol_syslog('margin::customerMargins.php', LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
@ -293,19 +315,19 @@ if ($result) {
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (!empty($client)) {
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", "&socid=".$socid, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&socid=".$socid, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
} else {
|
||||
print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", "&socid=".$socid, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
|
||||
print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
|
||||
print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -73,18 +73,18 @@ if (!$sortfield) {
|
||||
}
|
||||
|
||||
$startdate = $enddate = '';
|
||||
|
||||
if (!empty($_POST['startdatemonth'])) {
|
||||
$startdate = dol_mktime(0, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']);
|
||||
if (GETPOST('startdatemonth')) {
|
||||
$startdate = dol_mktime(0, 0, 0, GETPOST('startdatemonth', 'int'), GETPOST('startdateday', 'int'), GETPOST('startdateyear', 'int'));
|
||||
}
|
||||
if (!empty($_POST['enddatemonth'])) {
|
||||
$enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
|
||||
if (GETPOST('enddatemonth')) {
|
||||
$enddate = dol_mktime(23, 59, 59, GETPOST('enddatemonth', 'int'), GETPOST('enddateday', 'int'), GETPOST('enddateyear'));
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new Product($db);
|
||||
$hookmanager->initHooks(array('marginproductlist'));
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -149,7 +149,7 @@ print '<table class="border centpercent">';
|
||||
|
||||
// Total Margin
|
||||
print '<tr><td class="titlefield">'.$langs->trans("TotalMargin").'</td><td colspan="4">';
|
||||
print '<span id="totalMargin"></span>'; // set by jquery (see below)
|
||||
print '<span id="totalMargin" class="amount"></span> <span class="amount">'.$langs->getCurrencySymbol($conf->currency).'</span>'; // set by jquery (see below)
|
||||
print '</td></tr>';
|
||||
|
||||
// Margin Rate
|
||||
@ -224,13 +224,31 @@ $sql .= $db->order($sortfield, $sortorder);
|
||||
// TODO: calculate total to display then restore pagination
|
||||
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||
|
||||
$param = '&id='.((int) $id);
|
||||
if (GETPOST('startdatemonth', 'int')) {
|
||||
$param .= '&startdateyear='.GETPOST('startdateyear', 'int');
|
||||
$param .= '&startdatemonth='.GETPOST('startdatemonth', 'int');
|
||||
$param .= '&startdateday='.GETPOST('startdateday', 'int');
|
||||
}
|
||||
if (GETPOST('enddatemonth', 'int')) {
|
||||
$param .= '&enddateyear='.GETPOST('enddateyear', 'int');
|
||||
$param .= '&enddatemonth='.GETPOST('enddatemonth', 'int');
|
||||
$param .= '&enddateday='.GETPOST('enddateday', 'int');
|
||||
}
|
||||
$listofcateg = GETPOST('categories', 'array:int');
|
||||
if (is_array($listofcateg)) {
|
||||
foreach ($listofcateg as $val) {
|
||||
$param .= '&categories[]='.$val;
|
||||
}
|
||||
}
|
||||
|
||||
dol_syslog('margin::productMargins.php', LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
print '<br>';
|
||||
print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "&id=".$id, $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1);
|
||||
print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1);
|
||||
|
||||
//var_dump($conf->global->MARGIN_TYPE);
|
||||
if ($conf->global->MARGIN_TYPE == "1") {
|
||||
@ -247,20 +265,20 @@ if ($result) {
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if ($id > 0) {
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", "&id=".$id, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&id=".$id, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
} else {
|
||||
print_liste_field_titre("ProductService", $_SERVER["PHP_SELF"], "p.ref", "", "&id=".$id, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductService", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "product_qty", "", "&id=".$id, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&id=".$id, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", "&id=".$id, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", "&id=".$id, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "product_qty", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
|
||||
print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", "&id=".$id, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
}
|
||||
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
|
||||
print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", "&id=".$id, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -662,8 +662,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
|
||||
$defaultstockmovementlabel = GETPOST('inventorylabel', 'alphanohtml') ? GETPOST('inventorylabel', 'alphanohtml') : $langs->trans("ProductionForRef", $object->ref);
|
||||
//$defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $object->ref.'_'.dol_print_date(dol_now(), 'dayhourlog');
|
||||
$defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $langs->trans("ProductionForRef", $object->ref);
|
||||
$defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : dol_print_date(dol_now(), 'dayhourlog');
|
||||
|
||||
print '<div class="center'.(in_array($action, array('consumeorproduce', 'consumeandproduceall')) ? ' formconsumeproduce' : '').'">';
|
||||
print '<div class="opacitymedium hideonsmartphone paddingbottom">'.$langs->trans("ConfirmProductionDesc", $langs->transnoentitiesnoconv("Confirm")).'<br></div>';
|
||||
@ -1008,6 +1007,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$disable = 'disabled';
|
||||
}
|
||||
|
||||
// input hidden with fk_product of line
|
||||
print '<input type="hidden" name="product-'.$line->id.'-'.$i.'" value="'.$line->fk_product.'">';
|
||||
|
||||
// Qty
|
||||
print '<td class="right"><input type="text" class="width50 right" id="qtytoconsume-'.$line->id.'-'.$i.'" name="qty-'.$line->id.'-'.$i.'" value="'.$preselected.'" '.$disable.'></td>';
|
||||
|
||||
|
||||
@ -4812,7 +4812,7 @@ class Product extends CommonObject
|
||||
$sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens
|
||||
$sql.= " ORDER BY pa.rang";
|
||||
|
||||
dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.$parents, LOG_DEBUG);
|
||||
dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.implode(',', $parents), LOG_DEBUG);
|
||||
|
||||
if ($level == 1) {
|
||||
$alreadyfound = array($id=>1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediatly
|
||||
|
||||
@ -70,8 +70,8 @@ if (!$user->rights->projet->lire) {
|
||||
$diroutputmassaction = $conf->project->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", "aZ09comma");
|
||||
$sortorder = GETPOST("sortorder", 'aZ09comma');
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
// If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
@ -224,7 +224,8 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$action = 'list'; $massaction = '';
|
||||
$action = 'list';
|
||||
$massaction = '';
|
||||
}
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
||||
$massaction = '';
|
||||
@ -349,13 +350,22 @@ if (empty($reshook)) {
|
||||
* View
|
||||
*/
|
||||
|
||||
$companystatic = new Societe($db);
|
||||
$form = new Form($db);
|
||||
|
||||
$companystatic = new Societe($db);
|
||||
$formother = new FormOther($db);
|
||||
$formproject = new FormProjets($db);
|
||||
|
||||
$help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
|
||||
$title = $langs->trans("Projects");
|
||||
$title = $langs->trans("LeadsOrProjects");
|
||||
if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
|
||||
$title = $langs->trans("Projects");
|
||||
}
|
||||
if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
|
||||
$title = $langs->trans("Leads");
|
||||
}
|
||||
$morejs = array();
|
||||
$morecss = array();
|
||||
|
||||
|
||||
// Get list of project id allowed to user (in a string list separated by comma)
|
||||
@ -863,7 +873,14 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
|
||||
|
||||
// Fields title search
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<tr class="liste_titre">';
|
||||
// Action column
|
||||
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons('left');
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
// Project ref
|
||||
if (!empty($arrayfields['p.ref']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
@ -1130,8 +1147,12 @@ $totalarray = array(
|
||||
'nbfield' => 0,
|
||||
'val' => array(),
|
||||
);
|
||||
while ($i < min($num, $limit)) {
|
||||
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||
while ($i < $imaxinloop) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if (empty($obj)) {
|
||||
break; // Should not happen
|
||||
}
|
||||
|
||||
$object->id = $obj->id;
|
||||
$object->user_author_id = $obj->fk_user_creat;
|
||||
@ -1512,15 +1533,17 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
}
|
||||
// Action column
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($obj->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
print '</td>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -1534,14 +1557,26 @@ while ($i < min($num, $limit)) {
|
||||
// Show total line
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||
|
||||
// If no record found
|
||||
if ($num == 0) {
|
||||
$colspan = 1;
|
||||
foreach ($arrayfields as $key => $val) {
|
||||
if (!empty($val['checked'])) {
|
||||
$colspan++;
|
||||
}
|
||||
}
|
||||
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
$parameters = array('sql' => $sql);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'sql' => $sql);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
// End of page
|
||||
|
||||
@ -1052,7 +1052,7 @@ while ($i < $imaxinloop) {
|
||||
// Description
|
||||
if (!empty($arrayfields['t.description']['checked'])) {
|
||||
print '<td>';
|
||||
print dol_escape_htmltag($object->description);
|
||||
print dolGetFirstLineOfText($object->description, 5);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
@ -601,7 +601,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Cancel
|
||||
if ($permissiontoadd) {
|
||||
if ($object->status == $object::STATUS_VALIDATED) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close">'.$langs->trans("Cancel").'</a>'."\n";
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken().'">'.$langs->trans("Cancel").'</a>'."\n";
|
||||
} elseif ($object->status == $object::STATUS_REFUSED || $object->status == $object::STATUS_CANCELED || $object->status == $object::STATUS_CONTRACT_REFUSED) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_reopen&confirm=yes&token='.newToken().'">'.$langs->trans("Re-Open").'</a>'."\n";
|
||||
}
|
||||
|
||||
@ -1445,24 +1445,19 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
$savalias = $obj->name_alias;
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
$companystatic->name_alias = '';
|
||||
}
|
||||
print '<td'.(empty($conf->global->MAIN_SOCIETE_SHOW_COMPLETE_NAME) ? ' class="tdoverflowmax200"' : '').' data-key="ref">';
|
||||
if ($contextpage == 'poslist') {
|
||||
print $obj->name;
|
||||
print dol_escape_htmltag($obj->name);
|
||||
} else {
|
||||
print $companystatic->getNomUrl(1, '', 100, 0, 1);
|
||||
print $companystatic->getNomUrl(1, '', 100, 0, 1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
|
||||
}
|
||||
print "</td>\n";
|
||||
$companystatic->name_alias = $savalias;
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($companystatic->name_alias).'">';
|
||||
print dol_escape_htmltag($companystatic->name_alias);
|
||||
print "</td>\n";
|
||||
if (!$i) {
|
||||
@ -1471,7 +1466,7 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
// Barcode
|
||||
if (!empty($arrayfields['s.barcode']['checked'])) {
|
||||
print '<td>'.dol_escape_htmltag($obj->barcode).'</td>';
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->barcode).'">'.dol_escape_htmltag($obj->barcode).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -887,6 +887,9 @@ textarea.centpercent {
|
||||
.cursornotallowed {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.cursorwait {
|
||||
cursor: wait;
|
||||
}
|
||||
.backgroundblank {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
@ -1032,6 +1032,9 @@ textarea.centpercent {
|
||||
.cursormove {
|
||||
cursor: move;
|
||||
}
|
||||
.cursorwait {
|
||||
cursor: wait;
|
||||
}
|
||||
.cursornotallowed {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
@ -81,14 +81,14 @@ if (!$action) {
|
||||
// Security check
|
||||
$id = GETPOST("id", 'int');
|
||||
if ($user->socid > 0) $socid = $user->socid;
|
||||
$result = restrictedArea($user, 'ticket', $id, '');
|
||||
$result = restrictedArea($user, 'ticket', $object->id, '');
|
||||
|
||||
// restrict access for externals users
|
||||
if ($user->socid > 0 && ($object->fk_soc != $user->socid)) {
|
||||
accessforbidden();
|
||||
}
|
||||
// or for unauthorized internals users
|
||||
if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
|
||||
if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ if ($socid > 0) {
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
|
||||
if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
|
||||
if (!$user->socid && !empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) {
|
||||
$object->next_prev_filter = "te.fk_user_assign = '".$user->id."'";
|
||||
} elseif ($user->socid > 0) {
|
||||
$object->next_prev_filter = "te.fk_soc = '".$user->socid."'";
|
||||
@ -162,11 +162,15 @@ if ($object->fk_user_create > 0) {
|
||||
$langs->load("users");
|
||||
$fuser = new User($db);
|
||||
$fuser->fetch($object->fk_user_create);
|
||||
$morehtmlref .= $fuser->getNomUrl(0);
|
||||
}
|
||||
if (!empty($object->origin_email)) {
|
||||
$morehtmlref .= $fuser->getNomUrl(-1);
|
||||
} elseif (!empty($object->email_msgid)) {
|
||||
$morehtmlref .= '<br>'.$langs->trans("CreatedBy").' : ';
|
||||
$morehtmlref .= $object->origin_email.' <small>('.$langs->trans("TicketEmailOriginIssuer").')</small>';
|
||||
$morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"');
|
||||
$morehtmlref .= dol_escape_htmltag($object->origin_email).' <small class="hideonsmartphone opacitymedium">('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')</small>';
|
||||
} elseif (!empty($object->origin_email)) {
|
||||
$morehtmlref .= '<br>'.$langs->trans("CreatedBy").' : ';
|
||||
$morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"');
|
||||
$morehtmlref .= dol_escape_htmltag($object->origin_email).' <small class="hideonsmartphone opacitymedium">('.$langs->trans("CreatedByPublicPortal").')</small>';
|
||||
}
|
||||
|
||||
// Thirdparty
|
||||
|
||||
@ -56,7 +56,7 @@ $ref = GETPOST('ref', 'alpha');
|
||||
$projectid = GETPOST('projectid', 'int');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$backtopage = GETPOST('$backtopage', 'alpha');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$contactid = GETPOST('contactid', 'int');
|
||||
|
||||
$notifyTiers = GETPOST("notify_tiers_at_create", 'alpha');
|
||||
@ -1508,6 +1508,8 @@ if ($action == 'create' || $action == 'presend') {
|
||||
|
||||
$formticket->withsubstit = 1;
|
||||
$formticket->substit = $substitutionarray;
|
||||
$formticket->backtopage = $backtopage;
|
||||
|
||||
$formticket->showMessageForm('100%');
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ if (!$sortfield) {
|
||||
$sortfield = "a.datep,a.id";
|
||||
}
|
||||
if (!$sortorder) {
|
||||
$sortorder = "desc";
|
||||
$sortorder = "DESC";
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
@ -245,12 +245,12 @@ if (!empty($object->id)) {
|
||||
|
||||
|
||||
// Show link to add a message (if read and not closed)
|
||||
$btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage";
|
||||
$url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init';
|
||||
$btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage";
|
||||
$url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id);
|
||||
$morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus);
|
||||
|
||||
// Show link to add event (if read and not closed)
|
||||
$btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage";
|
||||
$btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage";
|
||||
$url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id);
|
||||
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user