diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index a813a34135a..89a1c497388 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -4,6 +4,7 @@ * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010 Juanjo Menent + * 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 @@ -27,14 +28,16 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (! empty($conf->projet->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $langs->load("companies"); @@ -574,11 +577,15 @@ if ($action == 'create') // Project if (! empty($conf->projet->enabled)) { + + $formproject=new FormProjets($db); + // Projet associe $langs->load("project"); print ''.$langs->trans("Project").''; - $numproject=select_projects((! empty($societe->id)?$societe->id:0),GETPOST("projectid")?GETPOST("projectid"):'','projectid'); + + $numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:0),GETPOST("projectid")?GETPOST("projectid"):'','projectid'); if ($numproject==0) { print '   '.$langs->trans("AddProject").''; @@ -801,11 +808,14 @@ if ($id > 0) // Project if (! empty($conf->projet->enabled)) { + + $formproject=new FormProjets($db); + // Projet associe $langs->load("project"); print ''.$langs->trans("Project").''; - $numprojet=select_projects($act->societe->id,$act->fk_project,'projectid'); + $numprojet=$formproject->select_projects($act->societe->id,$act->fk_project,'projectid'); if ($numprojet==0) { print '   '.$langs->trans("AddProject").''; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index f95842884bb..7e59a9e2748 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -19,6 +19,10 @@ * along with this program. If not, see . */ +error_reporting(E_ALL); +ini_set('display_errors', true); +ini_set('html_errors', false); + /** * \file htdocs/comm/action/index.php * \ingroup agenda @@ -31,7 +35,9 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +if (! empty($conf->projet->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 0dab9196756..2fdf9315712 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -29,7 +29,6 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; $langs->load("companies"); $langs->load("agenda"); diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 33588045ee9..c93e7d6d966 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } $langs->load('companies'); @@ -1369,13 +1369,16 @@ if ($action == 'create') // Project if (! empty($conf->projet->enabled) && $socid>0) { + + $formproject=new FormProjets($db); + $projectid = 0; if ($origin == 'project') $projectid = ($originid?$originid:0); print ''; print ''.$langs->trans("Project").''; - $numprojet=select_projects($soc->id,$projectid); + $numprojet=$formproject->select_projects($soc->id,$projectid); if ($numprojet==0) { $langs->load("projects"); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index a9f2ed914e6..136a1fac354 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -53,6 +53,7 @@ $search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','al $search_refcustomer=GETPOST('search_refcustomer','alpha'); $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); +$search_author=GETPOST('search_author','alpha'); $sall=GETPOST("sall"); $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg")); @@ -99,6 +100,7 @@ if (GETPOST("button_removefilter_x")) $search_refcustomer=''; $search_societe=''; $search_montant_ht=''; + $search_author=''; $year=''; $month=''; } @@ -167,6 +169,10 @@ if ($search_societe) { $sql.= " AND s.nom LIKE '%".$db->escape(trim($search_societe))."%'"; } +if ($search_author) +{ + $sql.= " AND u.login LIKE '%".$db->escape(trim($search_author))."%'"; +} if ($search_montant_ht) { $sql.= " AND p.total_ht='".$db->escape(price2num(trim($search_montant_ht)))."'"; @@ -223,6 +229,7 @@ if ($result) if ($search_user > 0) $param.='&search_user='.$search_user; if ($search_sale > 0) $param.='&search_sale='.$search_sale; if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; + if ($search_author) $param.='&search_author='.$search_author; print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); // Lignes des champs de filtre @@ -250,7 +257,7 @@ if ($result) if (! empty($moreforfilter)) { print ''; - print ''; + print ''; print $moreforfilter; print ''; } @@ -284,10 +291,13 @@ if ($result) $formother->select_year($syear,'year',1, 20, 5); print ''; print ' '; - print ''; + print ''; print ''; print ''; - print ' '; + + print ''; + print ''; + print ''; print ''; $formpropal->select_propal_statut($viewstatut,1); print ''; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index b1520e40681..686d148d953 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -43,7 +43,7 @@ if (! empty($conf->propal->enabled)) require DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->projet->enabled)) { require DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -1626,8 +1626,10 @@ if ($action == 'create' && $user->rights->commande->creer) // Project if (! empty($conf->projet->enabled) && $socid>0) { + $formproject=new FormProjets($db); + print ''.$langs->trans('Project').''; - $numprojet=select_projects($soc->id,$projectid); + $numprojet=$formproject->select_projects($soc->id,$projectid); if ($numprojet==0) { print '   '.$langs->trans("AddProject").''; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 9631ced232b..f24a9a32b84 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -34,7 +34,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +if (! empty($conf->projet->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} $langs->load('orders'); $langs->load('deliveries'); @@ -425,9 +427,11 @@ if ($action == 'create' && empty($mesgs)) // Project if (! empty($conf->projet->enabled)) { + $formproject=new FormProjets($db); + $langs->load('projects'); print ''.$langs->trans('Project').''; - select_projects($soc->id, $projectid, 'projectid'); + $formproject->select_projects($soc->id, $projectid, 'projectid'); print ''; } diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index b09754c2405..bc2795e554f 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -30,7 +30,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php' require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; if (! empty($conf->projet->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index e04c6699848..1e13c9f9874 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -30,7 +30,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +if (! empty($conf->projet->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} $langs->load("companies"); $langs->load("donations"); @@ -317,9 +319,12 @@ if ($action == 'create') if (! empty($conf->projet->enabled)) { + + $formproject=new FormProjets($db); + // Si module projet actif print "".$langs->trans("Project").""; - select_projects('',$_POST["projectid"],"projectid"); + $formproject->select_projects('',$_POST["projectid"],"projectid"); print "\n"; } @@ -414,9 +419,11 @@ if (! empty($id) && $action == 'edit') // Project if (! empty($conf->projet->enabled)) { + $formproject=new FormProjets($db); + $langs->load('projects'); print ''.$langs->trans('Project').''; - select_projects(-1, (isset($_POST["projectid"])?$_POST["projectid"]:$don->fk_project), 'projectid'); + $formproject->select_projects(-1, (isset($_POST["projectid"])?$_POST["projectid"]:$don->fk_project), 'projectid'); print ''; } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index ae3a8b08a72..4e7ede6b50c 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -42,8 +42,10 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; +if (! empty($conf->projet->enabled)) { + require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $langs->load('bills'); @@ -1836,7 +1838,7 @@ else if ($action == 'print_file' AND $user->rights->printipp->read) { require_once DOL_DOCUMENT_ROOT.'/core/class/dolprintipp.class.php'; $printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD); - $printer->print_file(GETPOST('file',alpha),GETPOST('printer',alpha)); + $printer->print_file(GETPOST('file','alpha'),GETPOST('printer','alpha')); setEventMessage($langs->trans("FileWasSentToPrinter", GETPOST('file'))); $action=''; } @@ -2266,9 +2268,11 @@ if ($action == 'create') // Project if (! empty($conf->projet->enabled) && $socid>0) { + $formproject=new FormProjets($db); + $langs->load('projects'); print ''.$langs->trans('Project').''; - select_projects($soc->id, $projectid, 'projectid'); + $formproject->select_projects($soc->id, $projectid, 'projectid'); print ''; } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 9369a6341b0..6f41995971e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -43,7 +43,6 @@ if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; } $langs->load('bills'); diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 77553e67d13..7b3432aa07e 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -38,7 +38,7 @@ if (! empty($conf->produit->enabled) || ! empty($conf->service->enabled)) requi if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } $langs->load("contracts"); @@ -864,8 +864,10 @@ if ($action == 'create') if (! empty($conf->projet->enabled)) { + $formproject=new FormProjets($db); + print ''.$langs->trans("Project").''; - select_projects($soc->id,$projectid,"projectid"); + $formproject->select_projects($soc->id,$projectid,"projectid"); print ""; } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 5dc7c1c9755..2e014321b05 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -627,11 +627,11 @@ class ExtraFields { $tmp=explode(',',$size); $newsize=$tmp[0]; - $out=''; + $out=''; } elseif ($type == 'varchar') { - $out=''; + $out=''; } elseif ($type == 'text') { @@ -647,30 +647,30 @@ class ExtraFields } else { $checked=' value="1" '; } - $out=''; + $out=''; } elseif ($type == 'mail') { - $out=''; + $out=''; } elseif ($type == 'phone') { - $out=''; + $out=''; } elseif ($type == 'price') { - $out=' '.$langs->getCurrencySymbol($conf->currency); + $out=' '.$langs->getCurrencySymbol($conf->currency); } elseif ($type == 'double') { if (!empty($value)) { $value=price($value); } - $out=' '; + $out=' '; } elseif ($type == 'select') { - $out=''; foreach ($param['options'] as $key=>$val ) { $out.='