|
@@ -164,7 +164,7 @@ if ($id == '' && $ref == '') {
|
|
|
exit();
|
|
|
}
|
|
|
|
|
|
-$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0;
|
|
|
+$mine = GETPOST('mode') == 'mine' ? 1 : 0;
|
|
|
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
|
|
|
|
|
|
$object = new Project($db);
|
|
@@ -368,19 +368,19 @@ $listofreferent = array(
|
|
|
'class'=>'Entrepot',
|
|
|
'table'=>'entrepot',
|
|
|
'datefieldname'=>'date_entrepot',
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/product/stock/card.php?action=create&projectid='.$id,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/product/stock/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'entrepot',
|
|
|
'buttonnew'=>'AddWarehouse',
|
|
|
'project_field'=>'fk_project',
|
|
|
'testnew'=>$user->rights->stock->creer,
|
|
|
- 'test'=>$conf->stock->enabled && $user->rights->stock->lire),
|
|
|
+ 'test'=>$conf->stock->enabled && $user->rights->stock->lire && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT)),
|
|
|
'propal'=>array(
|
|
|
'name'=>"Proposals",
|
|
|
'title'=>"ListProposalsAssociatedProject",
|
|
|
'class'=>'Propal',
|
|
|
'table'=>'propal',
|
|
|
'datefieldname'=>'datep',
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/comm/propal/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/comm/propal/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'propal',
|
|
|
'buttonnew'=>'AddProp',
|
|
|
'testnew'=>$user->rights->propal->creer,
|
|
@@ -391,7 +391,7 @@ $listofreferent = array(
|
|
|
'class'=>'Commande',
|
|
|
'table'=>'commande',
|
|
|
'datefieldname'=>'date_commande',
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'orders',
|
|
|
'buttonnew'=>'CreateOrder',
|
|
|
'testnew'=>$user->rights->commande->creer,
|
|
@@ -403,7 +403,7 @@ $listofreferent = array(
|
|
|
'margin'=>'add',
|
|
|
'table'=>'facture',
|
|
|
'datefieldname'=>'datef',
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'bills',
|
|
|
'buttonnew'=>'CreateBill',
|
|
|
'testnew'=>$user->rights->facture->creer,
|
|
@@ -414,7 +414,7 @@ $listofreferent = array(
|
|
|
'class'=>'FactureRec',
|
|
|
'table'=>'facture_rec',
|
|
|
'datefieldname'=>'datec',
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'bills',
|
|
|
'buttonnew'=>'CreateBill',
|
|
|
'testnew'=>$user->rights->facture->creer,
|
|
@@ -425,7 +425,7 @@ $listofreferent = array(
|
|
|
'class'=>'SupplierProposal',
|
|
|
'table'=>'supplier_proposal',
|
|
|
'datefieldname'=>'date_valid',
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object
|
|
|
'lang'=>'supplier_proposal',
|
|
|
'buttonnew'=>'AddSupplierProposal',
|
|
|
'testnew'=>$user->rights->supplier_proposal->creer,
|
|
@@ -436,7 +436,7 @@ $listofreferent = array(
|
|
|
'class'=>'CommandeFournisseur',
|
|
|
'table'=>'commande_fournisseur',
|
|
|
'datefieldname'=>'date_commande',
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object
|
|
|
'lang'=>'suppliers',
|
|
|
'buttonnew'=>'AddSupplierOrder',
|
|
|
'testnew'=>($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer),
|
|
@@ -448,7 +448,7 @@ $listofreferent = array(
|
|
|
'margin'=>'minus',
|
|
|
'table'=>'facture_fourn',
|
|
|
'datefieldname'=>'datef',
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object
|
|
|
'lang'=>'suppliers',
|
|
|
'buttonnew'=>'AddSupplierInvoice',
|
|
|
'testnew'=>($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer),
|
|
@@ -459,7 +459,7 @@ $listofreferent = array(
|
|
|
'class'=>'Contrat',
|
|
|
'table'=>'contrat',
|
|
|
'datefieldname'=>'date_contrat',
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'contracts',
|
|
|
'buttonnew'=>'AddContract',
|
|
|
'testnew'=>$user->rights->contrat->creer,
|
|
@@ -472,7 +472,7 @@ $listofreferent = array(
|
|
|
'datefieldname'=>'date_valid',
|
|
|
'disableamount'=>0,
|
|
|
'margin'=>'minus',
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'interventions',
|
|
|
'buttonnew'=>'AddIntervention',
|
|
|
'testnew'=>$user->rights->ficheinter->creer,
|
|
@@ -483,7 +483,7 @@ $listofreferent = array(
|
|
|
'class'=>'Expedition',
|
|
|
'table'=>'expedition',
|
|
|
'datefieldname'=>'date_valid',
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/expedition/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/expedition/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'sendings',
|
|
|
'buttonnew'=>'CreateShipment',
|
|
|
'testnew'=>0,
|
|
@@ -494,7 +494,7 @@ $listofreferent = array(
|
|
|
'class'=>'Mo',
|
|
|
'table'=>'mrp_mo',
|
|
|
'datefieldname'=>'date_valid',
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/mrp/mo_card.php?action=create&origin=project&originid='.$id.'&socid='.$socid,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/mrp/mo_card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'mrp',
|
|
|
'buttonnew'=>'CreateMO',
|
|
|
'testnew'=>'$user->rights->mrp->write',
|
|
@@ -508,7 +508,7 @@ $listofreferent = array(
|
|
|
'datefieldname'=>'dated',
|
|
|
'margin'=>'minus',
|
|
|
'disableamount'=>1,
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/deplacement/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/deplacement/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'trips',
|
|
|
'buttonnew'=>'AddTrip',
|
|
|
'testnew'=>$user->rights->deplacement->creer,
|
|
@@ -521,7 +521,7 @@ $listofreferent = array(
|
|
|
'datefieldname'=>'date',
|
|
|
'margin'=>'minus',
|
|
|
'disableamount'=>0,
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/expensereport/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/expensereport/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'trips',
|
|
|
'buttonnew'=>'AddTrip',
|
|
|
'testnew'=>$user->rights->expensereport->creer,
|
|
@@ -534,7 +534,7 @@ $listofreferent = array(
|
|
|
'table'=>'don',
|
|
|
'datefieldname'=>'datedon',
|
|
|
'disableamount'=>0,
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/don/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/don/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'donations',
|
|
|
'buttonnew'=>'AddDonation',
|
|
|
'testnew'=>$user->rights->don->creer,
|
|
@@ -547,7 +547,7 @@ $listofreferent = array(
|
|
|
'table'=>'loan',
|
|
|
'datefieldname'=>'datestart',
|
|
|
'disableamount'=>0,
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/loan/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/loan/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'loan',
|
|
|
'buttonnew'=>'AddLoan',
|
|
|
'testnew'=>$user->rights->loan->write,
|
|
@@ -560,7 +560,7 @@ $listofreferent = array(
|
|
|
'table'=>'chargesociales',
|
|
|
'datefieldname'=>'date_ech',
|
|
|
'disableamount'=>0,
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/compta/sociales/card.php?action=create&projectid='.$id,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/compta/sociales/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'compta',
|
|
|
'buttonnew'=>'AddSocialContribution',
|
|
|
'testnew'=>$user->rights->tax->charges->lire,
|
|
@@ -573,7 +573,7 @@ $listofreferent = array(
|
|
|
'table'=>'projet_task',
|
|
|
'datefieldname'=>'task_date',
|
|
|
'disableamount'=>0,
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'buttonnew'=>'AddTimeSpent',
|
|
|
'testnew'=>$user->rights->projet->creer,
|
|
|
'test'=>($conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))),
|
|
@@ -594,9 +594,9 @@ $listofreferent = array(
|
|
|
'datefieldname'=>'datesp',
|
|
|
'margin'=>'minus',
|
|
|
'disableamount'=>0,
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/salaries/card.php?action=create&projectid='.$id,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/salaries/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'salaries',
|
|
|
- 'buttonnew'=>'AddSalaryPayment',
|
|
|
+ 'buttonnew'=>'AddSalary',
|
|
|
'testnew'=>$user->rights->salaries->write,
|
|
|
'test'=>$conf->salaries->enabled && $user->rights->salaries->read),
|
|
|
'variouspayment'=>array(
|
|
@@ -607,7 +607,7 @@ $listofreferent = array(
|
|
|
'datefieldname'=>'datev',
|
|
|
'margin'=>'minus',
|
|
|
'disableamount'=>0,
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&projectid='.$id,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'banks',
|
|
|
'buttonnew'=>'AddVariousPayment',
|
|
|
'testnew'=>$user->rights->banque->modifier,
|
|
@@ -620,7 +620,7 @@ $listofreferent = array(
|
|
|
'table'=>'actioncomm',
|
|
|
'datefieldname'=>'datep',
|
|
|
'disableamount'=>1,
|
|
|
- 'urlnew'=>DOL_URL_ROOT.'/comm/action/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
|
|
+ 'urlnew'=>DOL_URL_ROOT.'/comm/action/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
|
|
'lang'=>'agenda',
|
|
|
'buttonnew'=>'AddEvent',
|
|
|
'testnew'=>$user->rights->agenda->myactions->create,
|