diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 887290b1247..6b47d5205b6 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1710,7 +1710,7 @@ if ($action == 'create') $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->propal->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->propal->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project if (! empty($conf->projet->enabled)) { diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 33504a1d27b..f82732a49ff 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2009 Destailleur Laurent + * Copyright (C) 2005-2016 Destailleur Laurent * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2015 Philippe Grand * @@ -149,66 +149,61 @@ $formother = new FormOther($db); if ($object->id > 0) { - $head = propal_prepare_head($object); + $head = propal_prepare_head($object); dol_fiche_head($head, 'contact', $langs->trans("Proposal"), 0, 'propal'); - /* - * Propal synthese pour rappel - */ - print ''; - $linkback=''.$langs->trans("BackToList").''; - - // Ref - print ''; - - // Ref client - print ''; - print ''; - - // Customer - print ""; - print ''; - - // Delivery address - if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) + // Proposal card + + $linkback = '' . $langs->trans("BackToList") . ''; + + + $morehtmlref='
'; + // Ref customer + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + // Project + if (! empty($conf->projet->enabled)) { - print '
'; + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($user->rights->propal->creer) + { + if ($action != 'classify') + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; + $morehtmlref.=' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.=''; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } } + $morehtmlref.=''; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); - print "
'.$langs->trans('Ref').''; - print $form->showrefnav($object,'ref',$linkback,1,'ref','ref',''); - print '
'; - print ''; - print '
'; - print $langs->trans('RefCustomer').''; - print '
'; - print '
'; - print $object->ref_client; - print '
".$langs->trans("Company")."'.$object->thirdparty->getNomUrl(1).'
'; - print ''; - - if ($action != 'editdelivery_address' && ! empty($object->brouillon)) - print ''; - print '
'; - print $langs->trans('DeliveryAddress'); - print 'socid.'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'
'; - print '
'; - - if ($action == 'editdelivery_address') - { - $formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'fk_address','propal',$object->id); - } - else - { - $formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'none','propal',$object->id); - } - print '
"; - - print ''; - - print '
'; - + dol_fiche_end(); + + // Contacts lines (modules that overwrite templates must declare this into descriptor) $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); foreach($dirtpls as $reldir) diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 289ba272b8c..9b875e434f7 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -100,36 +100,70 @@ if ($object->id > 0) } - print ''; - - $linkback=''.$langs->trans("BackToList").''; - - // Ref - print ''; - - // Ref client - print ''; - print ''; - - // Customer - print ""; - print ''; - - print ''; - print ''; - - print '
'.$langs->trans('Ref').''; - print $form->showrefnav($object,'ref',$linkback,1,'ref','ref',''); - print '
'; - print ''; - print '
'; - print $langs->trans('RefCustomer').''; - print '
'; - print '
'; - print $object->ref_client; - print '
".$langs->trans("Company")."'.$object->thirdparty->getNomUrl(1).'
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; - + // Proposal card + + $linkback = '' . $langs->trans("BackToList") . ''; + + + $morehtmlref='
'; + // Ref customer + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($user->rights->propal->creer) + { + if ($action != 'classify') + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; + $morehtmlref.=' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } + } + $morehtmlref.='
'; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + print '
'; + + print ''; + + // Files infos + print ''; + print ''; + + print "
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
\n"; + print '
'; + + + dol_fiche_end(); $modulepart = 'propal'; $permission = $user->rights->propal->creer; diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index d3a3899537b..8415cb8618f 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -54,12 +54,66 @@ dol_fiche_head($head, 'info', $langs->trans('Proposal'), 0, 'propal'); $object->info($object->id); -print '
'; + +// Proposal card + +$linkback = '' . $langs->trans("BackToList") . ''; + + +$morehtmlref='
'; +// Ref customer +$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); +$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); +// Thirdparty +$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); +// Project +if (! empty($conf->projet->enabled)) +{ + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($user->rights->propal->creer) + { + if ($action != 'classify') + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; + $morehtmlref.=' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } +} +$morehtmlref.='
'; + +dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + +print '
'; +print '
'; + +print '
'; + dol_print_object_info($object); -print '
'; +print ''; print ''; - +dol_fiche_end(); + llxFooter(); $db->close(); diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 89f31256717..d161fe03870 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry @@ -45,10 +45,9 @@ $result = restrictedArea($user, 'propale', $id, 'propal'); $object = new Propal($db); - -/******************************************************************************/ -/* Actions */ -/******************************************************************************/ +/* + * Actions + */ $permissionnote=$user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php @@ -56,9 +55,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, -/******************************************************************************/ -/* Affichage fiche */ -/******************************************************************************/ +/* + * View + */ llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); @@ -70,10 +69,9 @@ if ($id > 0 || ! empty($ref)) $now=dol_now(); - if ($object->fetch($id, $ref)) + if ($object->fetch($id, $ref) > 0) { - $societe = new Societe($db); - if ( $societe->fetch($object->socid) ) + if ($object->fetch_thirdparty() > 0) { $head = propal_prepare_head($object); dol_fiche_head($head, 'note', $langs->trans('Proposal'), 0, 'propal'); @@ -81,71 +79,64 @@ if ($id > 0 || ! empty($ref)) $cssclass='titlefield'; //if ($action == 'editnote_public') $cssclass='titlefieldcreate'; //if ($action == 'editnote_private') $cssclass='titlefieldcreate'; - - print ''; - - $linkback = ''.$langs->trans('BackToList').''; - - // Ref - print ''; - - // Ref client - print ''; - print ''; - - // Customer - if ( is_null($object->thirdparty) ) - $object->fetch_thirdparty(); - print ""; - print ''; - - // Discounts - print ''; - - // Date - print ''; - print ''; - - // Date fin propal - print ''; - print ''; - print ''; - - print "
'.$langs->trans('Ref').''; - print $form->showrefnav($object,'ref',$linkback,1,'ref','ref',''); - print '
'; - print ''; - print '
'; - print $langs->trans('RefCustomer').''; - print '
'; - print '
'; - print $object->ref_client; - print '
".$langs->trans("Company")."'.$object->thirdparty->getNomUrl(1).'
'.$langs->trans('Discounts').''; - if ($societe->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_percent); - else print $langs->trans("CompanyHasNoRelativeDiscount"); - $absolute_discount=$societe->getAvailableDiscounts(); - print '. '; - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency)); - else print $langs->trans("CompanyHasNoAbsoluteDiscount"); - print '.'; - print '
'.$langs->trans('Date').''; - print dol_print_date($object->date,'daytext'); - print '
'.$langs->trans('DateEndPropal').''; - if ($object->fin_validite) + + + // Proposal card + + $linkback = '' . $langs->trans("BackToList") . ''; + + + $morehtmlref='
'; + // Ref customer + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + // Project + if (! empty($conf->projet->enabled)) { - print dol_print_date($object->fin_validite,'daytext'); - if ($object->statut == Propal::STATUS_VALIDATED && $object->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($user->rights->propal->creer) + { + if ($action != 'classify') + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; + $morehtmlref.=' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } } - else - { - print $langs->trans("Unknown"); - } - print '
"; - - //print '
'; + $morehtmlref.=''; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + print '
'; + print '
'; + include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; + print '
'; + print ''; + dol_fiche_end(); } } diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index c9344306eb6..7d80032e1d9 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -740,7 +740,7 @@ if ($resql) { // Ref print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['m.datem']['checked'])) @@ -758,20 +758,20 @@ if ($resql) { // Product Ref print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['p.label']['checked'])) { // Product label print ''; - print ''; + print ''; print ''; } // Batch if (! empty($arrayfields['m.batch']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['pl.eatby']['checked'])) { @@ -795,21 +795,21 @@ if ($resql) { // Author print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['m.inventorycode']['checked'])) { // Inventory code print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['m.label']['checked'])) { // Label of movement print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['origin']['checked'])) @@ -823,7 +823,7 @@ if ($resql) { // Qty print ''; - print ''; + print ''; print ''; } // Extra fields diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index d5768c355a2..f6f1a51fed7 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -143,6 +143,7 @@ if ($object->id > 0) print "\n"; print ''; + dol_fiche_end();