diff --git a/ChangeLog b/ChangeLog index fd951104b7d..c344e464673 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: +- New: PDF event report show project and status of event. - New: Can filter on status on interventions. - New: Add help info of field type into dictionary of payment types. - New: Add proposals into referer page of thirdparty. diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 3df7acec765..a9a19f57a9e 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -92,7 +92,7 @@ if ($resql) { $num = $db->num_rows($resql); - print_barre_liste($langs->trans("Actions"), $page, "index.php",'',$sortfield,$sortorder,'',$num); + print_barre_liste($langs->trans("Actions"), $page, $_SERVER["PHP_SELF"],'',$sortfield,$sortorder,'',$num); $i = 0; print ''; diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index e7d86a5d1a8..1f03ea19d62 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -27,6 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; /** * Class to generate event report @@ -59,6 +61,7 @@ class CommActionRapport { global $conf,$langs; $langs->load("commercial"); + $langs->load("projects"); $this->db = $db; $this->description = ""; @@ -197,9 +200,9 @@ class CommActionRapport $y++; $pdf->SetFont('','',8); - $sql = "SELECT s.nom as societe, s.rowid as socid, s.client,"; + $sql = "SELECT s.nom as thirdparty, s.rowid as socid, s.client,"; $sql.= " a.id, a.datep as dp, a.datep2 as dp2,"; - $sql.= " a.fk_contact, a.note, a.percent as percent, a.label,"; + $sql.= " a.fk_contact, a.note, a.percent as percent, a.label, a.fk_project,"; $sql.= " c.code, c.libelle,"; $sql.= " u.login"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a"; @@ -209,6 +212,9 @@ class CommActionRapport $sql.= " AND '".$this->db->idate(dol_get_last_day($this->year,$this->month,false))."'"; $sql.= " ORDER BY a.datep DESC"; + $eventstatic=new ActionComm($this->db); + $projectstatic=new Project($this->db); + dol_syslog(get_class($this)."::_page", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -221,6 +227,11 @@ class CommActionRapport { $obj = $this->db->fetch_object($resql); + $eventstatic->id=$obj->id; + $eventstatic->percentage=$obj->percentage; + $eventstatic->fulldayevent=$obj->fulldayevent; + $eventstatic->punctual=$obj->punctual; + $y = max($y, $pdf->GetY(), $y0, $y1, $y2, $y3); // Calculate height of text @@ -228,6 +239,16 @@ class CommActionRapport if (! preg_match('/^'.preg_quote($obj->label).'/',$obj->note)) $text=$obj->label."\n"; $text.=$obj->note; $text=dol_trunc(dol_htmlentitiesbr_decode($text),150); + // Add status to text + $text.="\n"; + $status=dol_htmlentitiesbr_decode($eventstatic->getLibStatut(1,1)); + $text.=$status; + if ($obj->fk_project > 0) + { + $projectstatic->fetch($obj->fk_project); + $text.=($status?' - ':'').$outputlangs->transnoentitiesnoconv("Project").": ".dol_htmlentitiesbr_decode($projectstatic->getNomUrl(0, 'nolink')); + } + //print 'd'.$text; exit; $nboflines=dol_nboflines($text); $heightlinemax=max(2*$height,$nboflines*$height); @@ -249,7 +270,7 @@ class CommActionRapport // Third party $pdf->SetXY(26, $y); - $pdf->MultiCell(32, $height, dol_trunc($outputlangs->convToOutputCharset($obj->societe),32), 0, 'L', 0); + $pdf->MultiCell(32, $height, dol_trunc($outputlangs->convToOutputCharset($obj->thirdparty),32), 0, 'L', 0); $y1 = $pdf->GetY(); // Action code diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 65140e72679..c60d2c9eac4 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -796,7 +796,7 @@ class Fichinter extends CommonObject * * @param User $user Object user who modify * @param string $description description - * @return int <0 if ko, >0 if ok + * @return int <0 if KO, >0 if OK */ function set_description($user, $description) { @@ -808,7 +808,6 @@ class Fichinter extends CommonObject $sql.= " SET description = '".$this->db->escape($description)."'"; $sql.= " WHERE rowid = ".$this->id; $sql.= " AND entity = ".$conf->entity; - $sql.= " AND fk_statut = 0"; if ($this->db->query($sql)) { diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 0ffca1d2742..dab1831bcad 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1627,8 +1627,10 @@ else if ($id > 0 || ! empty($ref)) // Modify if ($object->statut == 1 && $user->rights->ficheinter->creer) { - print '
'.$langs->trans("Modify").'
'; + print '
'; + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) print $langs->trans("Modify"); + else print $langs->trans("SetToDraft"); + print '
'; } // Send diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 8540b665b55..1256dd533e3 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -645,6 +645,7 @@ OptionalFieldsSetup=Extra attributes setup URLPhoto=URL of photo/logo SetLinkToThirdParty=Link to another third party CreateDraft=Create draft +SetToDraft=Back to draft ClickToEdit=Click to edit ObjectDeleted=Object %s deleted ByCountry=By country diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index e6baf54974d..7d89d6f833c 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -645,6 +645,7 @@ OptionalFieldsSetup=Configuration des attributs complémentaires URLPhoto=URL de la photo/logo SetLinkToThirdParty=Lier vers un autre tiers CreateDraft=Créer brouillon +SetToDraft=Repasser en brouillon ClickToEdit=Cliquer ici pour éditer ObjectDeleted=Objet %s supprimé ByCountry=Par pays diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 6e2b4b5f727..0aa9f0e5979 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -179,7 +179,7 @@ if ($type_element == 'fichinter') { // Customer : show products from invoices require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $documentstatic=new Fichinter($db); - $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, '; + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, '; $tables_from = MAIN_DB_PREFIX."fichinter as f LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as d ON d.fk_fichinter = f.rowid"; // Must use left join to work also with option that disable usage of lines. $where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid; $where.= " AND f.entity = ".$conf->entity; @@ -190,7 +190,7 @@ if ($type_element == 'invoice') { // Customer : show products from invoices require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $documentstatic=new Facture($db); - $sql_select = 'SELECT f.rowid as doc_id, f.facnumber as doc_number, f.type as doc_type, f.datef as dateprint, '; + $sql_select = 'SELECT f.rowid as doc_id, f.facnumber as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, '; $tables_from = MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."facturedet as d"; $where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid; $where.= " AND d.fk_facture = f.rowid"; @@ -203,7 +203,7 @@ if ($type_element == 'propal') { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $documentstatic=new Propal($db); - $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.datep as datePrint, '; + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.datep as datePrint, c.fk_statut as status, '; $tables_from = MAIN_DB_PREFIX."propal as c,".MAIN_DB_PREFIX."propaldet as d"; $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid; $where.= " AND d.fk_propal = c.rowid"; @@ -216,7 +216,7 @@ if ($type_element == 'order') { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $documentstatic=new Commande($db); - $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as dateprint, '; + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as dateprint, c.fk_statut as status, '; $tables_from = MAIN_DB_PREFIX."commande as c,".MAIN_DB_PREFIX."commandedet as d"; $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid; $where.= " AND d.fk_commande = c.rowid"; @@ -229,7 +229,7 @@ if ($type_element == 'supplier_invoice') { // Supplier : Show products from invoices. require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $documentstatic=new FactureFournisseur($db); - $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datef as dateprint, '; + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datef as dateprint, f.fk_statut as status, '; $tables_from = MAIN_DB_PREFIX."facture_fourn as f,".MAIN_DB_PREFIX."facture_fourn_det as d"; $where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid; $where.= " AND d.fk_facture_fourn = f.rowid"; @@ -241,7 +241,7 @@ if ($type_element == 'supplier_order') { // Supplier : Show products from orders. require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; $documentstatic=new CommandeFournisseur($db); - $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, '; + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, '; $tables_from = MAIN_DB_PREFIX."commande_fournisseur as c,".MAIN_DB_PREFIX."commande_fournisseurdet as d"; $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid; $where.= " AND d.fk_commande = c.rowid"; @@ -296,6 +296,7 @@ print '
'."\n"; print ''; print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'doc_number','',$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'dateprint','',$param,'align="center" width="150"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans('Status'),$_SERVER['PHP_SELF'],'fk_status','',$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Product'),$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Quantity'),$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder); // Filters @@ -307,6 +308,8 @@ print ''; +print ''; print ''; @@ -323,16 +326,26 @@ if ($sql_select) $i = 0; while (($objp = $db->fetch_object($resql)) && $i < $conf->liste_limit ) { - $var=!$var; - print ""; - print '"; + print ''; print ''; + // Status + print ''; + print '
'; // date print $formother->select_month($month?$month:-1,'month',1); $formother->select_year($year?$year:-1,'year',1, 20, 1); print ''; +print ''; print ''; print '
'; $documentstatic->id=$objp->doc_id; $documentstatic->ref=$objp->doc_number; $documentstatic->type=$objp->type; + $documentstatic->fk_statut=$objp->status; + $documentstatic->fk_status=$objp->status; + $documentstatic->statut=$objp->status; + $documentstatic->status=$objp->status; + + $var=!$var; + print "
'; print $documentstatic->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->dateprint),'day').''; + print $documentstatic->getLibStatut(2); + print ''; // Define text, description and type