diff --git a/htdocs/boutique/client/client.class.php b/htdocs/boutique/client/client.class.php index b6a8e63a881..9ee7923502c 100644 --- a/htdocs/boutique/client/client.class.php +++ b/htdocs/boutique/client/client.class.php @@ -21,16 +21,16 @@ */ /** - \file htdocs/boutique/client/client.class.php - \brief Classe permettant de gèrer des clients de la boutique online - \author Rodolphe Quiedeville - \version $Revision$ -*/ + * \file htdocs/boutique/client/client.class.php + * \brief Classe permettant de gerer des clients de la boutique online + * \author Rodolphe Quiedeville + * \version $Revision$ + */ /** - \class Client - \brief Classe permettant de gèrer des clients de la boutique online -*/ + * \class Client + * \brief Classe permettant de gerer des clients de la boutique online + */ class Client { @@ -46,10 +46,9 @@ class Client } /** - \brief Fonction permettant de recupèrer les informations d'un clients de la boutique - \param id Id du client - */ - + * \brief Fonction permettant de recuperer les informations d'un clients de la boutique + * \param id Id du client + */ function fetch ($id) { global $conf; diff --git a/htdocs/html.formactions.class.php b/htdocs/html.formactions.class.php index 3547fa0314f..cef201b5087 100644 --- a/htdocs/html.formactions.class.php +++ b/htdocs/html.formactions.class.php @@ -18,7 +18,7 @@ /** \file htdocs/html.formactions.class.php - \brief Fichier de la classe des fonctions pr�d�finie de composants html actions + \brief Fichier de la classe des fonctions predefinie de composants html actions \version $Id$ */ @@ -106,6 +106,7 @@ class FormActions if ($typeelement == 'invoice') $sql.= ' AND a.fk_facture = '.$object->id; if ($typeelement == 'propal') $sql.= ' AND a.propalrowid = '.$object->id; if ($typeelement == 'order') $sql.= ' AND a.fk_commande = '.$object->id; + if ($typeelement == 'project') $sql.= ' AND a.fk_project = '.$object->id; dol_syslog("FormActions::showactions sql=".$sql); $resql = $this->db->query($sql); @@ -117,6 +118,8 @@ class FormActions if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill'); if ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal'); if ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder'); + if ($typeelement == 'project') $title=$langs->trans('ActionsOnProject'); + print_titre($title); $i = 0; $total = 0; $var=true; diff --git a/htdocs/html.formfile.class.php b/htdocs/html.formfile.class.php index f1e4e7333a4..fc37e6e04c0 100644 --- a/htdocs/html.formfile.class.php +++ b/htdocs/html.formfile.class.php @@ -227,6 +227,16 @@ class FormFile $modellist=$model->liste_modeles($this->db); } } + elseif ($modulepart == 'project') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once(DOL_DOCUMENT_ROOT.'/includes/modules/project/modules_project.php'); + $model=new ModelePDFProjects(); + $modellist=$model->liste_modeles($this->db); + } + } elseif ($modulepart == 'export') { if (is_array($genallowed)) $modellist=$genallowed; diff --git a/htdocs/includes/modules/project/pdf/pdf_baleine.modules.php b/htdocs/includes/modules/project/pdf/pdf_baleine.modules.php index 73ba5e2db11..5339b382477 100644 --- a/htdocs/includes/modules/project/pdf/pdf_baleine.modules.php +++ b/htdocs/includes/modules/project/pdf/pdf_baleine.modules.php @@ -70,8 +70,6 @@ class pdf_baleine extends ModelePDFProjects $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->franchise=!$mysoc->tva_assuj; - // Recupere emmetteur $this->emetteur=$mysoc; if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'�tait pas d�fini @@ -79,15 +77,7 @@ class pdf_baleine extends ModelePDFProjects // Defini position des colonnes $this->posxdesc=$this->marge_gauche+1; $this->posxcomm=120; - $this->posxtva=121; - $this->posxup=132; - $this->posxqty=168; - $this->posxdiscount=162; - $this->postotalht=177; - $this->tva=array(); - $this->atleastoneratenotnull=0; - $this->atleastonediscount=0; } /** @@ -167,8 +157,8 @@ class pdf_baleine extends ModelePDFProjects } // Complete object by loading several other informations + $tasks = $object->getTasksArray(0,0,1); $task = new Task($this->db); - $result = $task->fetch($object->id); $pdf->Open(); $pagenb=0; @@ -193,9 +183,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetTextColor(0,0,0); $tab_top = 90; - $tab_top_newpage = 50; - $tab_height = 110; - $tab_height_newpage = 150; + $tab_height = 150; // Affiche notes if (! empty($object->note_public)) @@ -258,27 +246,9 @@ class pdf_baleine extends ModelePDFProjects $nblineFollowDesc = 0; } - // Test if a new page is required - if ($pagenb == 1) + if (($nexY+$nblineFollowDesc) > ($tab_top+$tab_height) && $i < ($nblignes - 1)) { - $tab_top_in_current_page=$tab_top; - $tab_height_in_current_page=$tab_height; - } - else - { - $tab_top_in_current_page=$tab_top_newpage; - $tab_height_in_current_page=$tab_height_newpage; - } - if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblignes - 1)) - { - if ($pagenb == 1) - { - $this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs); - } - else - { - $this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs); - } + $this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs); $this->_pagefoot($pdf, $object, $outputlangs); @@ -295,17 +265,8 @@ class pdf_baleine extends ModelePDFProjects } // Show square - if ($pagenb == 1) - { - $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs); - $bottomlasttab=$tab_top + $tab_height + 1; - } - else - { - $this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs); - $bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1; - } - + $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs); + $bottomlasttab=$tab_top + $tab_height + 1; /* * Pied de page @@ -357,28 +318,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetFont('Arial','',10); $pdf->SetXY ($this->posxdesc-1, $tab_top+2); - $pdf->MultiCell(80,2, $outputlangs->transnoentities("Designation"),'','L'); - - // Modif SEB pour avoir une col en plus pour les commentaires clients - $pdf->line($this->posxcomm, $tab_top, $this->posxcomm, $tab_top + $tab_height); - $pdf->SetXY ($this->posxcomm, $tab_top+2); - $pdf->MultiCell(80,2, $outputlangs->transnoentities("Comments"),'','L'); - - // Qty - $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); - $pdf->SetXY ($this->posxqty-1, $tab_top+2); - $pdf->MultiCell(30, 2, $outputlangs->transnoentities("QtyShipped"),'','R'); - - // Modif Seb cadres signatures - $pdf->SetFont('Arial','',10); - $larg_sign = ($this->page_largeur-$this->marge_gauche-$this->marge_droite)/3; - $pdf->Rect($this->marge_gauche, ($tab_top + $tab_height + 3), $larg_sign, 25 ); - $pdf->SetXY ($this->marge_gauche + 2, $tab_top + $tab_height + 5); - $pdf->MultiCell($larg_sign,2, $outputlangs->trans("For").' '.$outputlangs->convToOutputCharset($mysoc->nom).":",'','L'); - - $pdf->Rect(2*$larg_sign+$this->marge_gauche, ($tab_top + $tab_height + 3), $larg_sign, 25 ); - $pdf->SetXY (2*$larg_sign+$this->marge_gauche + 2, $tab_top + $tab_height + 5); - $pdf->MultiCell($larg_sign,2, $outputlangs->trans("ForCustomer").':','','L'); + $pdf->MultiCell(80,2, $outputlangs->transnoentities("Task"),'','L'); } @@ -422,22 +362,13 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetFont('Arial','B',13); $pdf->SetXY(100,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 4, $outputlangs->transnoentities("DeliveryOrder")." ".$outputlangs->convToOutputCharset($object->ref), '' , 'R'); + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Project")." ".$outputlangs->convToOutputCharset($object->ref), '' , 'R'); $pdf->SetFont('Arial','',12); $posy+=6; $pdf->SetXY(100,$posy); $pdf->SetTextColor(0,0,60); - if ($object->date_valid) - { - $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_valid,"%d %b %Y",false,$outputlangs,true), '', 'R'); - } - else - { - $pdf->SetTextColor(255,0,0); - $pdf->MultiCell(100, 4, $outputlangs->transnoentities("DeliveryNotValidated"), '', 'R'); - $pdf->SetTextColor(0,0,60); - } + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->dateo,"%d %b %Y",false,$outputlangs,true), '', 'R'); $pdf->SetTextColor(0,0,60); @@ -519,50 +450,26 @@ class pdf_baleine extends ModelePDFProjects $object->fetch_client(); - // If SHIPPING contact defined on invoice, we use it - $usecontact=false; - $arrayidcontact=$object->commande->getIdContact('external','SHIPPING'); + // Nom client + $carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); + + // Nom du contact facturation si c'est une societe + $arrayidcontact = $object->getIdContact('external','PROJECTLEADER'); if (sizeof($arrayidcontact) > 0) { - $usecontact=true; - $result=$object->fetch_contact($arrayidcontact[0]); - } - - if ($usecontact) - { - $socname = $object->client->nom; - $carac_client_name=$outputlangs->convToOutputCharset($socname); - - // Customer name - $carac_client = $outputlangs->convToOutputCharset($object->contact->getFullName($outputlangs,1,1)); - - // Customer properties - $carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->address); - $carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->cp) . " " . $outputlangs->convToOutputCharset($object->contact->ville)."\n"; - if ($object->contact->pays_code && $object->contact->pays_code != $this->emetteur->pays_code) $carac_client.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$object->contact->pays_code))."\n"; - } - else - { - // Nom client - $carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); - - // Nom du contact facturation si c'est une societe - $arrayidcontact = $object->getIdContact('external','SHIPPING'); - if (sizeof($arrayidcontact) > 0) + $object->fetch_contact($arrayidcontact[0]); + // On verifie si c'est une societe ou un particulier + if( !preg_match('#'.$object->contact->getFullName($outputlangs,1).'#isU',$object->client->nom) ) { - $object->fetch_contact($arrayidcontact[0]); - // On verifie si c'est une societe ou un particulier - if( !preg_match('#'.$object->contact->getFullName($outputlangs,1).'#isU',$object->client->nom) ) - { - $carac_client .= "\n".$outputlangs->convToOutputCharset($object->contact->getFullName($outputlangs,1,1)); - } + $carac_client .= "\n".$outputlangs->convToOutputCharset($object->contact->getFullName($outputlangs,1,1)); } - - // Caracteristiques client - $carac_client.="\n".$outputlangs->convToOutputCharset($object->client->address); - $carac_client.="\n".$outputlangs->convToOutputCharset($object->client->cp) . " " . $outputlangs->convToOutputCharset($object->client->ville)."\n"; - if ($object->client->pays_code && $object->client->pays_code != $this->emetteur->pays_code) $carac_client.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$object->client->pays_code))."\n"; } + + // Caracteristiques client + $carac_client.="\n".$outputlangs->convToOutputCharset($object->client->address); + $carac_client.="\n".$outputlangs->convToOutputCharset($object->client->cp) . " " . $outputlangs->convToOutputCharset($object->client->ville)."\n"; + if ($object->client->pays_code && $object->client->pays_code != $this->emetteur->pays_code) $carac_client.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$object->client->pays_code))."\n"; + // Numero TVA intracom if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($object->client->tva_intra); diff --git a/htdocs/project.class.php b/htdocs/project.class.php index c86e34a57b8..a31967a1918 100644 --- a/htdocs/project.class.php +++ b/htdocs/project.class.php @@ -648,7 +648,7 @@ class Project extends CommonObject if (is_object($userp)) $sql .= " AND (p.fk_user_resp = ".$userp->id." OR p.fk_user_resp IS NULL OR p.fk_user_resp = -1)"; } $sql.= " ORDER BY p.ref, t.title"; - +print $sql; dol_syslog("Project::getTasksArray sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) @@ -813,11 +813,10 @@ class Project extends CommonObject // Initialise parametres $this->id=0; $this->ref = 'SPECIMEN'; - $this->ref_client='NEMICEPS'; $this->specimen=1; $socid = rand(1, $num_socs); $this->socid = $socids[$socid]; - $this->date = time(); + $this->dateo = time(); $this->note_public='SPECIMEN'; $nbp = rand(1, 9); $xnbp = 0; diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index 745b588b3b6..abcaf46903a 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -26,6 +26,7 @@ */ require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php"); if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); if ($conf->facture->enabled) require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); @@ -33,13 +34,8 @@ if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/commande $langs->load("projects"); -$projetid=''; -$ref=''; -if (isset($_GET["id"])) { $projetid=$_GET["id"]; } -else $_GET["id"]=$_POST["id"]; -if (isset($_GET["ref"])) { $ref=$_GET["ref"]; } - -//var_dump($_REQUEST);exit; +$projectid = (isset($_GET["id"])?$_GET["id"]:(isset($_POST["id"])?$_POST["id"]:'')); +$ref = (isset($_GET["ref"])?$_GET["ref"]:''); // If socid provided by ajax company selector if (! empty($_REQUEST['socid_id'])) @@ -49,12 +45,11 @@ if (! empty($_REQUEST['socid_id'])) $_REQUEST['socid'] = $_REQUEST['socid_id']; } - -if ($projetid == '' && $ref == '' && ($_GET['action'] != "create" && $_POST['action'] != "add" && $_POST["action"] != "update" && !$_POST["cancel"])) accessforbidden(); +if ($projectid == '' && $ref == '' && ($_GET['action'] != "create" && $_POST['action'] != "add" && $_POST["action"] != "update" && !$_POST["cancel"])) accessforbidden(); // Security check if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'projet', $projetid); +$result = restrictedArea($user, 'projet', $projectid); /* @@ -77,8 +72,8 @@ if ($_POST["action"] == 'add' && $user->rights->projet->creer) if (! $error) { - //print $_POST["socid"]; $project = new Project($db); + $project->ref = $_POST["ref"]; $project->title = $_POST["title"]; $project->socid = $_POST["socid"]; @@ -124,19 +119,19 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->projet- } if (! $error) { - $projet = new Project($db); - $projet->fetch($_POST["id"]); + $project = new Project($db); + $project->fetch($_POST["id"]); - $projet->ref = $_POST["ref"]; - $projet->title = $_POST["title"]; - $projet->socid = $_POST["socid"]; - $projet->user_resp_id = $_POST["officer_project"]; - $projet->date_start = dol_mktime(12,0,0,$_POST['projectmonth'],$_POST['projectday'],$_POST['projectyear']); - $projet->date_end = dol_mktime(12,0,0,$_POST['projectendmonth'],$_POST['projectendday'],$_POST['projectendyear']); + $project->ref = $_POST["ref"]; + $project->title = $_POST["title"]; + $project->socid = $_POST["socid"]; + $project->user_resp_id = $_POST["officer_project"]; + $project->date_start = dol_mktime(12,0,0,$_POST['projectmonth'],$_POST['projectday'],$_POST['projectyear']); + $project->date_end = dol_mktime(12,0,0,$_POST['projectendmonth'],$_POST['projectendday'],$_POST['projectendyear']); - $result=$projet->update($user); + $result=$project->update($user); - $_GET["id"]=$projet->id; // On retourne sur la fiche projet + $_GET["id"]=$project->id; // On retourne sur la fiche projet } else { @@ -181,9 +176,9 @@ if ($_REQUEST['action'] == 'confirm_reopen' && $_REQUEST['confirm'] == 'yes') if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == "yes" && $user->rights->projet->supprimer) { - $projet = new Project($db); - $projet->id = $_GET["id"]; - $result=$projet->delete($user); + $project = new Project($db); + $project->id = $_GET["id"]; + $result=$project->delete($user); if ($result >= 0) { Header("Location: index.php"); @@ -204,6 +199,7 @@ $help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; llxHeader("",$langs->trans("Projects"),$help_url); $html = new Form($db); +$formfile = new FormFile($db); if ($_GET["action"] == 'create' && $user->rights->projet->creer) { @@ -216,7 +212,6 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) print '
'; print ''; - //if ($_REQUEST["socid"]) print ''; print ''; print ''; @@ -226,17 +221,16 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) // Label print ''; - // Client + // Customer print ''; - // Responsable du projet + // Project leader print '
'.$langs->trans("Label").'*
'.$langs->trans("Company").''; - //print $_REQUEST["socid"]; print $html->select_societes($_REQUEST["socid"],'socid','',1,1); print '
'.$langs->trans("OfficerProject").''; if ($_REQUEST["mode"] != 'mine') { - $html->select_users($projet->user_resp_id,'officer_project',1); + $html->select_users($project->user_resp_id,'officer_project',1); } else { @@ -268,19 +262,19 @@ else if ($mesg) print $mesg; - $projet = new Project($db); - $projet->fetch($_GET["id"],$_GET["ref"]); + $project = new Project($db); + $project->fetch($_GET["id"],$_GET["ref"]); - if ($projet->societe->id > 0) $result=$projet->societe->fetch($projet->societe->id); - if ($projet->user_resp_id > 0) $result=$projet->fetch_user($projet->user_resp_id); + if ($project->societe->id > 0) $result=$project->societe->fetch($project->societe->id); + if ($project->user_resp_id > 0) $result=$project->fetch_user($project->user_resp_id); - $head=project_prepare_head($projet); + $head=project_prepare_head($project); dol_fiche_head($head, 'project', $langs->trans("Project"),0,'project'); // Confirmation validation if ($_GET['action'] == 'validate') { - $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$projet->id, $langs->trans('ValidateProject'), $langs->trans('ConfirmValidateProject'), 'confirm_validate','',0,1); + $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$project->id, $langs->trans('ValidateProject'), $langs->trans('ConfirmValidateProject'), 'confirm_validate','',0,1); if ($ret == 'html') print '
'; } // Confirmation close @@ -313,32 +307,32 @@ else print ''; // Ref - print ''; + print ''; // Label - print ''; + print ''; // Customer print ''; // Responsable du projet print ''; // Statut - print ''; + print ''; // Date start print ''; // Date end print ''; print ''; @@ -351,35 +345,35 @@ else // Ref print ''; // Label - print ''; + print ''; // Third party print ''; // Project leader print ''; // Statut - print ''; + print ''; // Date start print ''; // Date end print ''; print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").'
'.$langs->trans("Label").'
'.$langs->trans("Label").'
'.$langs->trans("Company").''; - print $html->select_societes($projet->societe->id,'socid','',1,1); + print $html->select_societes($project->societe->id,'socid','',1,1); print '
'.$langs->trans("OfficerProject").''; - $html->select_users($projet->user_resp_id,'officer_project',1); + $html->select_users($project->user_resp_id,'officer_project',1); print '
'.$langs->trans("Status").''.$projet->getLibStatut(4).'
'.$langs->trans("Status").''.$project->getLibStatut(4).'
'.$langs->trans("DateStart").''; - print $html->select_date($projet->date_start,'project'); + print $html->select_date($project->date_start,'project'); print '
'.$langs->trans("DateEnd").''; - print $html->select_date($projet->date_end?$projet->date_end:-1,'projectend'); + print $html->select_date($project->date_end?$project->date_end:-1,'projectend'); print '
 
'.$langs->trans("Ref").''; - print $html->showrefnav($projet,'ref','',1,'ref','ref'); + print $html->showrefnav($project,'ref','',1,'ref','ref'); print '
'.$langs->trans("Label").''.$projet->title.'
'.$langs->trans("Label").''.$project->title.'
'.$langs->trans("Company").''; - if ($projet->societe->id > 0) print $projet->societe->getNomUrl(1); + if ($project->societe->id > 0) print $project->societe->getNomUrl(1); else print' '; print '
'.$langs->trans("OfficerProject").''; - if ($projet->user->id) print $projet->user->getNomUrl(1); + if ($project->user->id) print $project->user->getNomUrl(1); else print $langs->trans('SharedProject'); print '
'.$langs->trans("Status").''.$projet->getLibStatut(4).'
'.$langs->trans("Status").''.$project->getLibStatut(4).'
'.$langs->trans("DateStart").''; - print dol_print_date($projet->date_start,'day'); + print dol_print_date($project->date_start,'day'); print '
'.$langs->trans("DateEnd").''; - print dol_print_date($projet->date_end,'day'); + print dol_print_date($project->date_end,'day'); print '
'; @@ -395,38 +389,103 @@ else if ($_GET["action"] != "edit") { // Validate - if ($projet->statut == 0 && $user->rights->projet->creer) + if ($project->statut == 0 && $user->rights->projet->creer) { print ''.$langs->trans("Valid").''; } // Modify - if ($projet->statut != 2 && $user->rights->projet->creer) + if ($project->statut != 2 && $user->rights->projet->creer) { - print ''.$langs->trans("Modify").''; + print ''.$langs->trans("Modify").''; } // Close - if ($projet->statut != 2 && $user->rights->projet->creer) + if ($project->statut != 2 && $user->rights->projet->creer) { - print ''.$langs->trans("Close").''; + print ''.$langs->trans("Close").''; } // Reopen - if ($projet->statut == 2 && $user->rights->projet->creer) + if ($project->statut == 2 && $user->rights->projet->creer) { - print ''.$langs->trans("ReOpen").''; + print ''.$langs->trans("ReOpen").''; } // Delete if ($user->rights->projet->supprimer) { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } } print ""; + print "
\n"; + + if ($_GET['action'] != 'presend') + { + print '
'; + print ''; // ancre + + + /* + * Documents generes + */ + $filename=dol_sanitizeFileName($project->ref); + $filedir=$conf->projet->dir_output . "/" . dol_sanitizeFileName($project->ref); + $urlsource=$_SERVER["PHP_SELF"]."?id=".$project->id; + $genallowed=$user->rights->projet->creer; + $delallowed=$user->rights->projet->supprimer; + + $var=true; + + $somethingshown=$formfile->show_documents('project',$filename,$filedir,$urlsource,$genallowed,$delallowed,$project->modelpdf); + + + /* + * Commandes rattachees + */ +/* if($conf->commande->enabled) + { + $propal->loadOrders(); + $coms = $propal->commandes; + if (sizeof($coms) > 0) + { + if ($somethingshown) { print '
'; $somethingshown=1; } + print_titre($langs->trans('RelatedOrders')); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $var=true; + for ($i = 0 ; $i < sizeof($coms) ; $i++) + { + $var=!$var; + print '\n"; + print ''; + print ''; + print ''; + print "\n"; + } + print '
'.$langs->trans("Ref").''.$langs->trans("Date").''.$langs->trans("Price").''.$langs->trans("Status").'
'; + print ''.img_object($langs->trans("ShowOrder"),"order").' '.$coms[$i]->ref."'.dol_print_date($coms[$i]->date,'day').''.price($coms[$i]->total_ttc).''.$coms[$i]->getLibStatut(3).'
'; + } + } +*/ + print '
'; + + // List of actions on element + include_once(DOL_DOCUMENT_ROOT.'/html.formactions.class.php'); + $formactions=new FormActions($db); + $somethingshown=$formactions->showactions($project,'project',$socid); + + print '
'; + } + }