Merge pull request #5604 from atm-florian/FIX_createpropalfromproject
FIX : create proposal from project
This commit is contained in:
commit
3b509db141
@ -1266,6 +1266,8 @@ if ($action == 'create')
|
|||||||
if ($origin != 'project' && $originid) {
|
if ($origin != 'project' && $originid) {
|
||||||
print '<input type="hidden" name="origin" value="' . $origin . '">';
|
print '<input type="hidden" name="origin" value="' . $origin . '">';
|
||||||
print '<input type="hidden" name="originid" value="' . $originid . '">';
|
print '<input type="hidden" name="originid" value="' . $originid . '">';
|
||||||
|
} elseif ($origin == 'project' && !empty($projectid)) {
|
||||||
|
print '<input type="hidden" name="projectid" value="' . $projectid . '">';
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_fiche_head();
|
dol_fiche_head();
|
||||||
|
|||||||
@ -955,7 +955,7 @@ if ($action == 'create')
|
|||||||
else
|
else
|
||||||
$numprojet=select_projects($societe->id,$_POST["projectid"],'projectid');
|
$numprojet=select_projects($societe->id,$_POST["projectid"],'projectid');
|
||||||
*/
|
*/
|
||||||
$numprojet=$formproject->select_projects($soc->id,GETPOST('projectid','int'),'projectid');
|
$numprojet=$formproject->select_projects($soc->id,$projectid,'projectid');
|
||||||
if ($numprojet==0)
|
if ($numprojet==0)
|
||||||
{
|
{
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddProject").'</a>';
|
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddProject").'</a>';
|
||||||
@ -1027,6 +1027,8 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
print '<input type="hidden" name="origin" value="'.$objectsrc->element.'">';
|
print '<input type="hidden" name="origin" value="'.$objectsrc->element.'">';
|
||||||
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
|
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
|
||||||
|
} elseif ($origin == 'project' && !empty($projectid)) {
|
||||||
|
print '<input type="hidden" name="projectid" value="' . $projectid . '">';
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
@ -1044,6 +1046,13 @@ if ($action == 'create')
|
|||||||
dol_fiche_head('');
|
dol_fiche_head('');
|
||||||
|
|
||||||
print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||||
|
if (is_object($objectsrc))
|
||||||
|
{
|
||||||
|
print '<input type="hidden" name="origin" value="'.$objectsrc->element.'">';
|
||||||
|
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
|
||||||
|
} elseif ($origin == 'project' && !empty($projectid)) {
|
||||||
|
print '<input type="hidden" name="projectid" value="' . $projectid . '">';
|
||||||
|
}
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("ThirdParty").'</td><td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("ThirdParty").'</td><td>';
|
||||||
print $form->select_company('','socid','','SelectThirdParty',1);
|
print $form->select_company('','socid','','SelectThirdParty',1);
|
||||||
|
|||||||
@ -193,7 +193,7 @@ $listofreferent=array(
|
|||||||
'class'=>'Propal',
|
'class'=>'Propal',
|
||||||
'table'=>'propal',
|
'table'=>'propal',
|
||||||
'datefieldname'=>'datep',
|
'datefieldname'=>'datep',
|
||||||
'urlnew'=>DOL_URL_ROOT.'/comm/propal/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
'urlnew'=>DOL_URL_ROOT.'/comm/propal/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid,
|
||||||
'lang'=>'propal',
|
'lang'=>'propal',
|
||||||
'buttonnew'=>'AddProp',
|
'buttonnew'=>'AddProp',
|
||||||
'testnew'=>$user->rights->propal->creer,
|
'testnew'=>$user->rights->propal->creer,
|
||||||
@ -284,7 +284,7 @@ $listofreferent=array(
|
|||||||
'table'=>'fichinter',
|
'table'=>'fichinter',
|
||||||
'datefieldname'=>'date_valid',
|
'datefieldname'=>'date_valid',
|
||||||
'disableamount'=>1,
|
'disableamount'=>1,
|
||||||
'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid,
|
||||||
'lang'=>'interventions',
|
'lang'=>'interventions',
|
||||||
'buttonnew'=>'AddIntervention',
|
'buttonnew'=>'AddIntervention',
|
||||||
'testnew'=>$user->rights->ficheinter->creer,
|
'testnew'=>$user->rights->ficheinter->creer,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user