|
@@ -143,9 +143,9 @@ $usercandelete = (($user->rights->fournisseur->commande->supprimer || $user->rig
|
|
|
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate)));
|
|
|
|
|
|
// Additional area permissions
|
|
|
-$usercanapprove = $user->rights->fournisseur->commande->approuver;
|
|
|
-$usercanapprovesecond = $user->rights->fournisseur->commande->approve2;
|
|
|
-$usercanorder = $user->rights->fournisseur->commande->commander;
|
|
|
+$usercanapprove = !empty($user->rights->fournisseur->commande->approuver) ? $user->rights->fournisseur->commande->approuver : 0;
|
|
|
+$usercanapprovesecond = !empty($user->rights->fournisseur->commande->approve2) ? $user->rights->fournisseur->commande->approve2 : 0;
|
|
|
+$usercanorder = !empty($user->rights->fournisseur->commande->commander) ? $user->rights->fournisseur->commande->commander : 0;
|
|
|
if (empty($conf->reception->enabled)) {
|
|
|
$usercanreceive = $user->rights->fournisseur->commande->receptionner;
|
|
|
} else {
|
|
@@ -1627,8 +1627,8 @@ if ($action == 'create') {
|
|
|
// Object source contacts list
|
|
|
$srccontactslist = $objectsrc->liste_contact(-1, 'external', 1);
|
|
|
} else {
|
|
|
- $cond_reglement_id = $societe->cond_reglement_supplier_id;
|
|
|
- $mode_reglement_id = $societe->mode_reglement_supplier_id;
|
|
|
+ $cond_reglement_id = !empty($societe->cond_reglement_supplier_id) ? $societe->cond_reglement_supplier_id : 0;
|
|
|
+ $mode_reglement_id = !empty($societe->mode_reglement_supplier_id) ? $societe->mode_reglement_supplier_id : 0;
|
|
|
|
|
|
if (!empty($conf->multicurrency->enabled) && !empty($societe->multicurrency_code)) {
|
|
|
$currency_code = $societe->multicurrency_code;
|
|
@@ -1674,7 +1674,7 @@ if ($action == 'create') {
|
|
|
print '<tr><td class="fieldrequired">'.$langs->trans('Supplier').'</td>';
|
|
|
print '<td>';
|
|
|
|
|
|
- if ($societe->id > 0) {
|
|
|
+ if (!empty($societe->id) && $societe->id > 0) {
|
|
|
print $societe->getNomUrl(1, 'supplier');
|
|
|
print '<input type="hidden" name="socid" value="'.$societe->id.'">';
|
|
|
} else {
|
|
@@ -1696,7 +1696,7 @@ if ($action == 'create') {
|
|
|
}
|
|
|
print '</td>';
|
|
|
|
|
|
- if ($societe->id > 0) {
|
|
|
+ if (!empty($societe->id) && $societe->id > 0) {
|
|
|
// Discounts for third party
|
|
|
print '<tr><td>'.$langs->trans('Discounts').'</td><td>';
|
|
|
|
|
@@ -1752,7 +1752,7 @@ if ($action == 'create') {
|
|
|
$langs->load('projects');
|
|
|
print '<tr><td>'.$langs->trans('Project').'</td><td>';
|
|
|
print img_picto('', 'project').$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
|
|
|
- print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$societe->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$societe->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
|
|
+ print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?action=create&status=1'.(!empty($societe->id) ? '&socid='.$societe->id : "").'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create'.(!empty($societe->id) ? '&socid='.$societe->id : "")).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
|
|
print '</td></tr>';
|
|
|
}
|
|
|
|