From cd8585da6397335487d62048aa43fbd0b638e6df Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 10 Aug 2016 11:54:49 +0200 Subject: [PATCH] fix for finche inter same problem --- htdocs/fichinter/card.php | 31 ++++++++++++++++++++----------- htdocs/projet/element.php | 2 +- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index a01ba2f1180..c12eba0a7c4 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -140,7 +140,7 @@ if (empty($reshook)) } } } - + if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->ficheinter->creer) { $result = $object->setValid($user); @@ -733,14 +733,14 @@ if (empty($reshook)) /* * Send mail */ - + // Actions to send emails $actiontypecode='AC_OTH_AUTO'; $trigger_name='FICHINTER_SENTBYMAIL'; $paramname='id'; $mode='emailfromintervention'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; - + if ($action == 'update_extras') { @@ -955,7 +955,7 @@ if ($action == 'create') else $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) { print '   '.$langs->trans("AddProject").''; @@ -1027,6 +1027,8 @@ if ($action == 'create') { print ''; print ''; + } elseif ($origin == 'project' && !empty($projectid)) { + print ''; } dol_fiche_end(); @@ -1044,6 +1046,13 @@ if ($action == 'create') dol_fiche_head(''); print '
'; + if (is_object($objectsrc)) + { + print ''; + print ''; + } elseif ($origin == 'project' && !empty($projectid)) { + print ''; + } print ''; print ''; print ''; } - + if (! empty($conf->global->FICHINTER_USE_PLANNED_AND_DONE_DATES)) { // Date Start @@ -1177,14 +1186,14 @@ else if ($id > 0 || ! empty($ref)) print $object->dateo ? dol_print_date($object->dateo, 'daytext') : ' '; print ''; print ''; - + // Date End print ''; print ''; print ''; - + // Date Terminate/close print ''; print ''; - + // Duration print '
'.$langs->trans("ThirdParty").''; print $form->select_company('','socid','','SelectThirdParty',1); @@ -1137,7 +1146,7 @@ else if ($id > 0 || ! empty($ref)) // Paiement incomplet. On demande si motif = escompte ou autre $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneIntervention'), $langs->trans('ConfirmCloneIntervention', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } - + if (!$formconfirm) { $parameters=array('lineid'=>$lineid); @@ -1168,7 +1177,7 @@ else if ($id > 0 || ! empty($ref)) print ''.convertSecondToTime($object->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).'
'.$langs->trans("Datee").''; print $object->datee ? dol_print_date($object->datee, 'daytext') : ' '; print '
'.$langs->trans("Datet").''; @@ -1428,7 +1437,7 @@ else if ($id > 0 || ! empty($ref)) print ''; $form->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention"); print ''; if (empty($conf->global->FICHINTER_WITHOUT_DURATION)) { @@ -1629,7 +1638,7 @@ else if ($id > 0 || ! empty($ref)) if ($user->rights->ficheinter->creer) { print ''; } - + // Delete if (($object->statut == 0 && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer) { @@ -1742,7 +1751,7 @@ else if ($id > 0 || ! empty($ref)) { include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'int'.$object->id); - } + } $formmail->withfrom=1; $liste=array(); foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 017a03fd4bd..629b89f9a8b 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -284,7 +284,7 @@ $listofreferent=array( 'table'=>'fichinter', 'datefieldname'=>'date_valid', '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', 'buttonnew'=>'AddIntervention', 'testnew'=>$user->rights->ficheinter->creer,