From ca6a973d9614076a51e977bd69e0ab6789e673c9 Mon Sep 17 00:00:00 2001 From: lalaina rasamoelina Date: Tue, 27 Aug 2013 15:51:06 +0200 Subject: [PATCH] T940-develop: creating a bouton which permit to create an event in the propal,and command . If we create an event in the propal, then the events will be attached in the propal and if it's for command,it will be attached in the command --- htdocs/comm/action/fiche.php | 15 +++++++++++++-- htdocs/comm/propal.php | 10 ++++++++-- htdocs/commande/fiche.php | 8 ++++++-- htdocs/core/class/commonobject.class.php | 1 + 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 81a635e4d9f..74e1b302ccc 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -51,6 +51,8 @@ $action=GETPOST('action','alpha'); $cancel=GETPOST('cancel','alpha'); $backtopage=GETPOST('backtopage','alpha'); $contactid=GETPOST('contactid','int'); +$origin=GETPOST('origin','alpha'); +$originid=GETPOST('originid','int'); // Security check $socid = GETPOST('socid','int'); @@ -142,6 +144,8 @@ if ($action == 'add_action') $actioncomm->location = GETPOST("location"); $actioncomm->transparency = (GETPOST("transparency")=='on'?1:0); $actioncomm->label = trim(GETPOST('label')); + $actioncomm->fk_element = GETPOST("fk_element"); + $actioncomm->elementtype = GETPOST("elementtype"); if (! GETPOST('label')) { if (GETPOST('actioncode') == 'AC_RDV' && $contact->getFullName($langs)) @@ -327,7 +331,8 @@ if ($action == 'update') $actioncomm->fk_project = $_POST["projectid"]; $actioncomm->note = $_POST["note"]; $actioncomm->pnote = $_POST["note"]; - + $actioncomm->fk_element = $_POST["fk_element"]; + $actioncomm->elementtype = $_POST["elementtype"]; if (! $datef && $percentage == 100) { $error=$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")); @@ -476,7 +481,7 @@ if ($action == 'create') // Full day print ''.$langs->trans("EventOnFullDay").''; - + // Date start $datep=$actioncomm->datep; if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0); @@ -593,6 +598,11 @@ if ($action == 'create') } print ''; } + if(!empty($origin) && !empty($originid)) + { + print ''; + print ''; + } if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/',GETPOST("datep"),$reg)) { @@ -610,6 +620,7 @@ if ($action == 'create') $doleditor=new DolEditor('note',(GETPOST('note')?GETPOST('note'):$actioncomm->note),'',240,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_7,90); $doleditor->Create(); print ''; + // Other attributes $parameters=array(); diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 235e6e7ef9b..8883f5e641f 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1646,8 +1646,9 @@ else if ($absolute_discount) { if ($object->statut > 0) - { + { print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); + } else { @@ -2096,7 +2097,12 @@ else if (count($object->lines) > 0) print '
'.$langs->trans('Validate').'
'; //else print ''.$langs->trans('Validate').''; } - + //Creer un evenement + if ($conf->agenda->enabled) + { + print ''.$langs->trans("AddAction").''; + + } // Edit if ($object->statut == 1 && $user->rights->propal->creer) { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 8f710dadca4..57f38468f0a 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -2381,13 +2381,17 @@ else { print '
'.$langs->trans('Validate').'
'; } - // Edit if ($object->statut == 1 && $user->rights->commande->creer) { print '
'.$langs->trans('Modify').'
'; } - + //Creer un evenement + if ($conf->agenda->enabled) + { + print ''.$langs->trans("AddAction").''; + + } // Send if ($object->statut > 0) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9fb99f69173..2ebe933f285 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2584,6 +2584,7 @@ abstract class CommonObject } } + /* This is to show add lines */