diff --git a/htdocs/comm/admin/askpricesupplier_extrafields.php b/htdocs/comm/admin/askpricesupplier_extrafields.php new file mode 100644 index 00000000000..fa0bd058f0f --- /dev/null +++ b/htdocs/comm/admin/askpricesupplier_extrafields.php @@ -0,0 +1,157 @@ + + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/comm/admin/propal_extrafields.php + * \ingroup propal + * \brief Page to setup extra fields of third party + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/askpricesupplier.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + +$langs->load("companies"); +$langs->load("admin"); +$langs->load('askpricesupplier'); + +$extrafields = new ExtraFields($db); +$form = new Form($db); + +// List of supported format +$tmptype2label=ExtraFields::$type2label; +$type2label=array(''); +foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); + +$action=GETPOST('action', 'alpha'); +$attrname=GETPOST('attrname', 'alpha'); +$elementtype='askpricesupplier'; //Must be the $table_element of the class that manage extrafield + +if (!$user->admin) accessforbidden(); + + +/* + * Actions + */ + +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; + + + +/* + * View + */ + +$textobject=$langs->transnoentitiesnoconv("Proposals"); + + +llxHeader('',$langs->trans("AskPriceSupplierSetup")); + + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("AskPriceSupplierSetup"),$linkback,'setup'); + + +$head = propal_admin_prepare_head(); + +dol_fiche_head($head, 'attributes', $langs->trans("CommRequests"), 0, 'askpricesupplier'); + + +print $langs->trans("DefineHereComplementaryAttributes",$textobject).'
'."\n"; +print '
'; + +// Load attribute_label +$extrafields->fetch_name_optionals_label($elementtype); + +print ""; + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +$var=True; +foreach($extrafields->attribute_type as $key => $value) +{ + $var=!$var; + print ""; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; + print ""; + // $i++; +} + +print "
'.$langs->trans("Position").''.$langs->trans("Label").''.$langs->trans("AttributeCode").''.$langs->trans("Type").''.$langs->trans("Size").''.$langs->trans("Unique").''.$langs->trans("Required").' 
".$extrafields->attribute_pos[$key]."".$extrafields->attribute_label[$key]."".$key."".$type2label[$extrafields->attribute_type[$key]]."'.$extrafields->attribute_size[$key]."'.yn($extrafields->attribute_unique[$key])."'.yn($extrafields->attribute_required[$key])."'.img_edit().''; + print "  ".img_delete()."
"; + +dol_fiche_end(); + + +// Buttons +if ($action != 'create' && $action != 'edit') +{ + print '
'; + print ''; + print "
"; +} + + +/* ************************************************************************** */ +/* */ +/* Creation d'un champ optionnel + /* */ +/* ************************************************************************** */ + +if ($action == 'create') +{ + print "
"; + print_titre($langs->trans('NewAttribute')); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; +} + +/* ************************************************************************** */ +/* */ +/* Edition d'un champ optionnel */ +/* */ +/* ************************************************************************** */ +if ($action == 'edit' && ! empty($attrname)) +{ + print "
"; + print_titre($langs->trans("FieldEdition", $attrname)); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; +} + +llxFooter(); + +$db->close(); diff --git a/htdocs/comm/admin/askpricesupplierdet_extrafields.php b/htdocs/comm/admin/askpricesupplierdet_extrafields.php new file mode 100644 index 00000000000..85647950276 --- /dev/null +++ b/htdocs/comm/admin/askpricesupplierdet_extrafields.php @@ -0,0 +1,159 @@ + + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 Florian Henry + * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2013 Florian Henry + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/comm/admin/propaldet_extrafields.php + * \ingroup order + * \brief Page to setup extra fields of order + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/askpricesupplier.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + + +if (!$user->admin) + accessforbidden(); + +$langs->load("admin"); +$langs->load("other"); +$langs->load("askpricesupplier"); + +$extrafields = new ExtraFields($db); +$form = new Form($db); + +// List of supported format +$tmptype2label=ExtraFields::$type2label; +$type2label=array(''); +foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); + +$action=GETPOST('action', 'alpha'); +$attrname=GETPOST('attrname', 'alpha'); + +$elementtype='askpricesupplierdet'; //Must be the $table_element of the class that manage extrafield + +if (!$user->admin) accessforbidden(); + + +/* + * Actions + */ + +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; + + + +/* + * View + */ + +$textobject=$langs->transnoentitiesnoconv("CommRequests"); + +llxHeader('',$langs->trans("AskPriceSupplierSetup")); + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("AskPriceSupplierSetup"),$linkback,'setup'); + +$head = propal_admin_prepare_head(); + +dol_fiche_head($head, 'attributeslines', $langs->trans("CommRequests"), 0, 'askpricesupplier'); + + +print $langs->trans("DefineHereComplementaryAttributes",$textobject).'
'."\n"; +print '
'; + +// Load attribute_label +$extrafields->fetch_name_optionals_label($elementtype); + +print ""; + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +$var=True; +foreach($extrafields->attribute_type as $key => $value) +{ + $var=!$var; + print ""; + print "\n"; + print "\n"; + print "\n"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; + print ""; +} + +print "
'.$langs->trans("Label").''.$langs->trans("AttributeCode").''.$langs->trans("Type").''.$langs->trans("Size").''.$langs->trans("Unique").''.$langs->trans("Required").' 
".$extrafields->attribute_label[$key]."".$key."".$type2label[$extrafields->attribute_type[$key]]."'.$extrafields->attribute_size[$key]."'.yn($extrafields->attribute_unique[$key])."'.yn($extrafields->attribute_required[$key])."'.img_edit().''; + print "  ".img_delete()."
"; + +dol_fiche_end(); + + +// Buttons +if ($action != 'create' && $action != 'edit') +{ + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; +} + + +/* ************************************************************************** */ +/* */ +/* Creation d'un champ optionnel */ +/* */ +/* ************************************************************************** */ + +if ($action == 'create') +{ + print "
"; + print_titre($langs->trans('NewAttribute')); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; +} + +/* ************************************************************************** */ +/* */ +/* Edition d'un champ optionnel */ +/* */ +/* ************************************************************************** */ +if ($action == 'edit' && ! empty($attrname)) +{ + print "
"; + print_titre($langs->trans("FieldEdition", $attrname)); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; +} + +llxFooter(); + +$db->close(); diff --git a/htdocs/comm/askpricesupplier.php b/htdocs/comm/askpricesupplier.php index bd694f4a925..1cdd560bb49 100644 --- a/htdocs/comm/askpricesupplier.php +++ b/htdocs/comm/askpricesupplier.php @@ -1190,7 +1190,7 @@ llxHeader('', $langs->trans('CommRequests'), 'EN:Commercial_Proposals|FR:Proposi $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); -$formpropal = new FormPropal($db); +$formaskpricesupplier = new FormAskPriceSupplier($db); $companystatic = new Societe($db); $now = dol_now(); diff --git a/htdocs/comm/askpricesupplier/apercu.php b/htdocs/comm/askpricesupplier/apercu.php index 87281e7ea63..a434bca9354 100644 --- a/htdocs/comm/askpricesupplier/apercu.php +++ b/htdocs/comm/askpricesupplier/apercu.php @@ -27,11 +27,11 @@ */ require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/askpricesupplier/class/askpricesupplier.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/askpricesupplier.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -$langs->load('propal'); +$langs->load('askpricesupplier'); $langs->load("bills"); $langs->load('compta'); @@ -40,7 +40,7 @@ $socid=0; $id = GETPOST('id','int'); $ref = GETPOST("ref"); if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'propal', $id); +$result = restrictedArea($user, 'askpricesupplier', $id); /* @@ -52,7 +52,7 @@ llxHeader(); if ($id > 0 || ! empty($ref)) { - $object = new Propal($db); + $object = new AskPriceSupplier($db); if ($object->fetch($id,$ref) > 0) { @@ -60,7 +60,7 @@ if ($id > 0 || ! empty($ref)) $soc->fetch($object->socid); $head = propal_prepare_head($object); - dol_fiche_head($head, 'preview', $langs->trans('Proposal'), 0, 'propal'); + dol_fiche_head($head, 'preview', $langs->trans('CommRequest'), 0, 'askpricesupplier'); /* diff --git a/htdocs/comm/askpricesupplier/contact.php b/htdocs/comm/askpricesupplier/contact.php index 6a0a1076e62..7ebb852d9bb 100644 --- a/htdocs/comm/askpricesupplier/contact.php +++ b/htdocs/comm/askpricesupplier/contact.php @@ -25,9 +25,9 @@ */ require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/askpricesupplier/class/askpricesupplier.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/askpricesupplier.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; @@ -43,9 +43,9 @@ $action=GETPOST('action','alpha'); // Security check if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'propal', $id); +$result = restrictedArea($user, 'askpricesupplier', $id); -$object = new Propal($db); +$object = new AskPriceSupplier($db); // Load object if ($id > 0 || ! empty($ref)) @@ -69,7 +69,7 @@ if (! $error) } else { - header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php'); + header('Location: '.DOL_URL_ROOT.'/comm/askpricesupplier/list.php'); exit; } @@ -78,7 +78,7 @@ else * Ajout d'un nouveau contact */ -if ($action == 'addcontact' && $user->rights->propale->creer) +if ($action == 'addcontact' && $user->rights->askpricesupplier->creer) { if ($object->id > 0) { @@ -106,7 +106,7 @@ if ($action == 'addcontact' && $user->rights->propale->creer) } // Bascule du statut d'un contact -else if ($action == 'swapstatut' && $user->rights->propale->creer) +else if ($action == 'swapstatut' && $user->rights->askpricesupplier->creer) { if ($object->id > 0) { @@ -115,7 +115,7 @@ else if ($action == 'swapstatut' && $user->rights->propale->creer) } // Efface un contact -else if ($action == 'deletecontact' && $user->rights->propale->creer) +else if ($action == 'deletecontact' && $user->rights->askpricesupplier->creer) { $result = $object->delete_contact($lineid); @@ -130,7 +130,7 @@ else if ($action == 'deletecontact' && $user->rights->propale->creer) } } -else if ($action == 'setaddress' && $user->rights->propale->creer) +else if ($action == 'setaddress' && $user->rights->askpricesupplier->creer) { $result=$object->setDeliveryAddress($_POST['fk_address']); if ($result < 0) dol_print_error($db,$object->error); @@ -141,7 +141,7 @@ else if ($action == 'setaddress' && $user->rights->propale->creer) * View */ -llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); +llxHeader('',$langs->trans('CommRequest'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); $form = new Form($db); $formcompany= new FormCompany($db); @@ -150,14 +150,14 @@ $formother = new FormOther($db); if ($object->id > 0) { $head = propal_prepare_head($object); - dol_fiche_head($head, 'contact', $langs->trans("Proposal"), 0, 'propal'); + dol_fiche_head($head, 'contact', $langs->trans("CommRequest"), 0, 'askpricesupplier'); /* * Propal synthese pour rappel */ print ''; - $linkback=''.$langs->trans("BackToList").''; + $linkback=''.$langs->trans("BackToList").''; // Ref print '
'.$langs->trans('Ref').''; @@ -194,7 +194,7 @@ if ($object->id > 0) if ($action == 'editdelivery_address') { - $formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'fk_address','propal',$object->id); + $formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'fk_address','askpricesupplier',$object->id); } else { diff --git a/htdocs/comm/askpricesupplier/document.php b/htdocs/comm/askpricesupplier/document.php index d224c20bc97..5dd239e1cfa 100644 --- a/htdocs/comm/askpricesupplier/document.php +++ b/htdocs/comm/askpricesupplier/document.php @@ -26,8 +26,8 @@ */ require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/askpricesupplier/class/askpricesupplier.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/askpricesupplier.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; @@ -47,7 +47,7 @@ if (! empty($user->societe_id)) $action=''; $socid = $user->societe_id; } -$result = restrictedArea($user, 'propal', $id); +$result = restrictedArea($user, 'askpricesupplier', $id); // Get parameters $sortfield = GETPOST("sortfield",'alpha'); @@ -60,12 +60,12 @@ $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="name"; -$object = new Propal($db); +$object = new AskPriceSupplier($db); $object->fetch($id,$ref); if ($object->id > 0) { $object->fetch_thirdparty(); - $upload_dir = $conf->propal->dir_output.'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->askpricesupplier->dir_output.'/'.dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; } @@ -79,7 +79,7 @@ if ($object->id > 0) * View */ -llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); +llxHeader('',$langs->trans('CommRequest'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); $form = new Form($db); @@ -88,7 +88,7 @@ if ($object->id > 0) $upload_dir = $conf->propal->dir_output.'/'.dol_sanitizeFileName($object->ref); $head = propal_prepare_head($object); - dol_fiche_head($head, 'document', $langs->trans('Proposal'), 0, 'propal'); + dol_fiche_head($head, 'document', $langs->trans('CommRequest'), 0, 'askpricesupplier'); // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); @@ -101,7 +101,7 @@ if ($object->id > 0) print ''; - $linkback=''.$langs->trans("BackToList").''; + $linkback=''.$langs->trans("BackToList").''; // Ref print ''; print ''; print '
'.$langs->trans('Ref').''; @@ -130,8 +130,8 @@ if ($object->id > 0) print ''; - $modulepart = 'propal'; - $permission = $user->rights->propal->creer; + $modulepart = 'askpricesupplier'; + $permission = $user->rights->askpricesupplier->creer; $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } diff --git a/htdocs/comm/askpricesupplier/info.php b/htdocs/comm/askpricesupplier/info.php index d3a3899537b..caa9f21dd1e 100644 --- a/htdocs/comm/askpricesupplier/info.php +++ b/htdocs/comm/askpricesupplier/info.php @@ -25,10 +25,10 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/askpricesupplier/class/askpricesupplier.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/askpricesupplier.lib.php'; -$langs->load('propal'); +$langs->load('askpricesupplier'); $langs->load('compta'); $id=GETPOST('id','int'); @@ -36,21 +36,21 @@ $socid=GETPOST('socid','int'); // Security check if (! empty($user->societe_id)) $socid=$user->societe_id; -$result = restrictedArea($user, 'propal', $id); +$result = restrictedArea($user, 'askpricesupplier', $id); /* * View */ -llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); +llxHeader('',$langs->trans('CommRequest'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); -$object = new Propal($db); +$object = new AskPriceSupplier($db); $object->fetch($id); $object->fetch_thirdparty(); $head = propal_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans('Proposal'), 0, 'propal'); +dol_fiche_head($head, 'info', $langs->trans('CommRequest'), 0, 'askpricesupplier'); $object->info($object->id); diff --git a/htdocs/comm/askpricesupplier/list.php b/htdocs/comm/askpricesupplier/list.php index 948482fe4cd..47eb078d401 100644 --- a/htdocs/comm/askpricesupplier/list.php +++ b/htdocs/comm/askpricesupplier/list.php @@ -126,7 +126,7 @@ llxHeader('',$langs->trans('CommRequest'),'EN:Commercial_Proposals|FR:Propositio $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); -$formpropal = new FormAskPriceSupplier($db); +$formaskpricesupplier = new FormAskPriceSupplier($db); $companystatic=new Societe($db); $now=dol_now(); @@ -145,7 +145,7 @@ $limit = $conf->liste_limit; $sql = 'SELECT s.rowid, s.nom as name, s.town, s.client, s.code_client,'; -$sql.= ' p.rowid as propalid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,'; +$sql.= ' p.rowid as askpricesupplierid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,'; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,"; $sql.= ' u.login'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'askpricesupplier as p'; @@ -322,7 +322,7 @@ if ($result) print ''; print ''; - $formpropal->selectProposalStatus($viewstatut,1); + $formaskpricesupplier->selectAskPriceSupplierStatus($viewstatut,1); print ''; @@ -366,7 +366,7 @@ if ($result) print ''; $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($objp->ref); - $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->propalid; + $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->askpricesupplierid; print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); print '
'; diff --git a/htdocs/comm/askpricesupplier/note.php b/htdocs/comm/askpricesupplier/note.php index 9292684d06f..c7b430dff8e 100644 --- a/htdocs/comm/askpricesupplier/note.php +++ b/htdocs/comm/askpricesupplier/note.php @@ -26,10 +26,10 @@ */ require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/askpricesupplier/class/askpricesupplier.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/askpricesupplier.lib.php'; -$langs->load('propal'); +$langs->load('askpricesupplier'); $langs->load('compta'); $langs->load('bills'); @@ -39,7 +39,7 @@ $action=GETPOST('action','alpha'); // Security check if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'propale', $id, 'propal'); +$result = restrictedArea($user, 'askpricesupplier', $id, 'askpricesupplier'); $object = new Propal($db); @@ -59,7 +59,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, /* Affichage fiche */ /******************************************************************************/ -llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); +llxHeader('',$langs->trans('CommRequest'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); $form = new Form($db); @@ -75,11 +75,11 @@ if ($id > 0 || ! empty($ref)) if ( $societe->fetch($object->socid) ) { $head = propal_prepare_head($object); - dol_fiche_head($head, 'note', $langs->trans('Proposal'), 0, 'propal'); + dol_fiche_head($head, 'note', $langs->trans('CommRequest'), 0, 'askpricesupplier'); print ''; - $linkback = ''.$langs->trans('BackToList').''; + $linkback = ''.$langs->trans('BackToList').''; // Ref print ''; - print '
'.$langs->trans('Ref').''; @@ -122,7 +122,7 @@ if ($id > 0 || ! empty($ref)) // Date fin propal print '
'.$langs->trans('DateEndPropal').''; + print ''.$langs->trans('DateEndAsk').''; if ($object->fin_validite) { print dol_print_date($object->fin_validite,'daytext'); diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 35807912c0a..a3fcfa22bc8 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -488,7 +488,7 @@ if (empty($reshook)) setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); } } - + if (! $error) { $db->commit(); diff --git a/htdocs/core/lib/askpricesupplier.lib.php b/htdocs/core/lib/askpricesupplier.lib.php index fd227d512b7..b0b9369f6ee 100644 --- a/htdocs/core/lib/askpricesupplier.lib.php +++ b/htdocs/core/lib/askpricesupplier.lib.php @@ -32,13 +32,13 @@ function propal_prepare_head($object) { global $langs, $conf, $user; - $langs->load("propal"); + $langs->load("askpricesupplier"); $langs->load("compta"); $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/comm/propal.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/comm/askpricesupplier.php?id='.$object->id; $head[$h][1] = $langs->trans('ProposalCard'); $head[$h][2] = 'comm'; $h++; @@ -47,7 +47,7 @@ function propal_prepare_head($object) || (! empty($conf->livraison_bon->enabled) && $user->rights->expedition->livraison->lire)))) { $langs->load("sendings"); - $head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/expedition/askpricesupplier.php?id='.$object->id; if ($conf->expedition_bon->enabled) $text=$langs->trans("Shipment"); if ($conf->livraison_bon->enabled) $text.='/'.$langs->trans("Receivings"); $head[$h][1] = $text; @@ -56,7 +56,7 @@ function propal_prepare_head($object) } if (! empty($conf->global->MAIN_USE_PREVIEW_TABS)) { - $head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/comm/askpricesupplier/apercu.php?id='.$object->id; $head[$h][1] = $langs->trans("Preview"); $head[$h][2] = 'preview'; $h++; @@ -64,7 +64,7 @@ function propal_prepare_head($object) if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { - $head[$h][0] = DOL_URL_ROOT.'/comm/propal/contact.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/comm/askpricesupplier/contact.php?id='.$object->id; $head[$h][1] = $langs->trans('ContactsAddresses'); $head[$h][2] = 'contact'; $h++; @@ -74,14 +74,14 @@ function propal_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf,$langs,$object,$head,$h,'propal'); + complete_head_from_modules($conf,$langs,$object,$head,$h,'askpricesupplier'); if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { $nbNote = 0; if(!empty($object->note_private)) $nbNote++; if(!empty($object->note_public)) $nbNote++; - $head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/comm/askpricesupplier/note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'note'; @@ -91,18 +91,18 @@ function propal_prepare_head($object) require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $upload_dir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$')); - $head[$h][0] = DOL_URL_ROOT.'/comm/propal/document.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/comm/askpricesupplier/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.''; $head[$h][2] = 'document'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/comm/propal/info.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/comm/askpricesupplier/info.php?id='.$object->id; $head[$h][1] = $langs->trans('Info'); $head[$h][2] = 'info'; $h++; - complete_head_from_modules($conf,$langs,$object,$head,$h,'propal','remove'); + complete_head_from_modules($conf,$langs,$object,$head,$h,'askpricesupplier','remove'); return $head; } @@ -119,7 +119,7 @@ function propal_admin_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/admin/propal.php'; + $head[$h][0] = DOL_URL_ROOT.'/admin/askpricesupplier.php'; $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $h++; @@ -128,19 +128,19 @@ function propal_admin_prepare_head() // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab - complete_head_from_modules($conf,$langs,null,$head,$h,'propal_admin'); + complete_head_from_modules($conf,$langs,null,$head,$h,'askpricesupplier_admin'); - $head[$h][0] = DOL_URL_ROOT.'/comm/admin/propal_extrafields.php'; + $head[$h][0] = DOL_URL_ROOT.'/comm/admin/askpricesupplier_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); $head[$h][2] = 'attributes'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/comm/admin/propaldet_extrafields.php'; + $head[$h][0] = DOL_URL_ROOT.'/comm/admin/askpricesupplierdet_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); $head[$h][2] = 'attributeslines'; $h++; - complete_head_from_modules($conf,$langs,null,$head,$h,'propal_admin','remove'); + complete_head_from_modules($conf,$langs,null,$head,$h,'askpricesupplier_admin','remove'); return $head; } diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index d1a1cedca61..b53e9cbd073 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -46,7 +46,7 @@ $savingdocmask=''; if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX)) { //var_dump($modulepart); - if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','ficheinter','contract','project','project_task'))) + if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal', 'askpricesupplier','ficheinter','contract','project','project_task'))) { $savingdocmask=$object->ref.'___file__'; } diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 66b310da69d..5773d7ce9d8 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -50,6 +50,7 @@ if (! empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) // Special cases if ($module == 'propal') { $permission=$user->rights->propale->creer;} +elseif ($module == 'askpricesupplier') { $permission=$user->rights->askpricesupplier->creer;} elseif ($module == 'fichinter') { $permission=$user->rights->ficheinter->creer;} elseif ($module == 'project') { $permission=$user->rights->projet->creer;} elseif ($module == 'project_task') { $permission=$user->rights->projet->creer;} diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 4ce603ee1ad..5b4f57ae6a4 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -42,7 +42,7 @@ class Societe extends CommonObject public $element='societe'; public $table_element = 'societe'; public $fk_element='fk_soc'; - protected $childtables=array("propal","commande","facture","contrat","facture_fourn","commande_fournisseur"); // To test if we can delete object + protected $childtables=array("askpricesupplier", "propal","commande","facture","contrat","facture_fourn","commande_fournisseur"); // To test if we can delete object /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe