Fix: renommage du champs "note" en "description"

Add: ajout des champs "note_private" et "note_public"
This commit is contained in:
Regis Houssin 2007-06-22 08:44:46 +00:00
parent c7111447b9
commit 426ede688a
6 changed files with 34 additions and 26 deletions

View File

@ -73,7 +73,7 @@ if ($_POST["action"] == 'add')
$fichinter->duree = $_POST["duree"];
$fichinter->projet_id = $_POST["projetidp"];
$fichinter->author = $user->id;
$fichinter->note = $_POST["note"];
$fichinter->description = $_POST["description"];
$fichinter->ref = $_POST["ref"];
$result = $fichinter->create();
@ -96,7 +96,7 @@ if ($_POST["action"] == 'update')
$fichinter->duree = $_POST["duree"];
$fichinter->projet_id = $_POST["projetidp"];
$fichinter->author = $user->id;
$fichinter->note = $_POST["note"];
$fichinter->description = $_POST["description"];
$fichinter->ref = $_POST["ref"];
$fichinter->update($_POST["id"]);
@ -210,12 +210,12 @@ if ($_GET["action"] == 'create')
{
// Editeur wysiwyg
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('note','',280,'dolibarr_notes','In',true);
$doleditor=new DolEditor('description','',280,'dolibarr_notes','In',true);
$doleditor->Create();
}
else
{
print '<textarea name="note" wrap="soft" cols="70" rows="15"></textarea>';
print '<textarea name="description" wrap="soft" cols="70" rows="15"></textarea>';
}
print '</td></tr>';
@ -301,12 +301,12 @@ elseif ($_GET["action"] == 'edit' && $_GET["id"] > 0)
{
// Editeur wysiwyg
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('note',$fichinter->note,280,'dolibarr_notes','In',true);
$doleditor=new DolEditor('description',$fichinter->description,280,'dolibarr_notes','In',true);
$doleditor->Create();
}
else
{
print '<textarea name="note" wrap="soft" cols="70" rows="12">'.$fichinter->note.'</textarea>';
print '<textarea name="description" wrap="soft" cols="70" rows="12">'.$fichinter->description.'</textarea>';
}
print '</td></tr>';
@ -369,7 +369,7 @@ elseif ($_GET["id"] > 0)
// Description
print '<tr><td valign="top">'.$langs->trans("Description").'</td>';
print '<td>';
print nl2br($fichinter->note);
print nl2br($fichinter->description);
print '</td></tr>';
print "</table>";

View File

@ -47,7 +47,9 @@ class Fichinter extends CommonObject
var $ref;
var $date;
var $duree;
var $note;
var $description
var $note_prive;
var $note_public;
var $projet_id;
@ -90,12 +92,12 @@ class Fichinter extends CommonObject
$this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."fichinter (fk_soc, datei, datec, ref, fk_user_author, note, duree";
$sql = "INSERT INTO ".MAIN_DB_PREFIX."fichinter (fk_soc, datei, datec, ref, fk_user_author, description, duree";
if ($this->projet_id) {
$sql .= ",fk_projet";
}
$sql .= ") ";
$sql .= " VALUES ($this->socid, $this->date, now(), '$this->ref', $this->author, '".addslashes($this->note)."', $this->duree";
$sql .= " VALUES ($this->socid, $this->date, now(), '$this->ref', $this->author, '".addslashes($this->description)."', $this->duree";
if ($this->projet_id) {
$sql .= ", ".$this->projet_id;
}
@ -137,7 +139,7 @@ class Fichinter extends CommonObject
*/
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter SET ";
$sql .= " datei = ".$this->date;
$sql .= ", note = '".addslashes($this->note)."'";
$sql .= ", description = '".addslashes($this->description)."'";
$sql .= ", duree = ".$this->duree;
$sql .= ", fk_projet = ".$this->projet_id;
$sql .= " WHERE rowid = $id";
@ -158,7 +160,7 @@ class Fichinter extends CommonObject
*/
function fetch($rowid)
{
$sql = "SELECT ref,note,fk_soc,fk_statut,duree,".$this->db->pdate(datei)." as di, fk_projet";
$sql = "SELECT ref,description,fk_soc,fk_statut,duree,".$this->db->pdate(datei)." as di, fk_projet";
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter WHERE rowid=".$rowid;
dolibarr_syslog("Fichinter.class::fetch rowid=$rowid sql=$sql");
@ -170,14 +172,14 @@ class Fichinter extends CommonObject
{
$obj = $this->db->fetch_object($resql);
$this->id = $rowid;
$this->date = $obj->di;
$this->duree = $obj->duree;
$this->ref = $obj->ref;
$this->note = $obj->note;
$this->socid = $obj->fk_soc;
$this->projet_id = $obj->fk_projet;
$this->statut = $obj->fk_statut;
$this->id = $rowid;
$this->date = $obj->di;
$this->duree = $obj->duree;
$this->ref = $obj->ref;
$this->description = $obj->description;
$this->socid = $obj->fk_soc;
$this->projet_id = $obj->fk_projet;
$this->statut = $obj->fk_statut;
$this->ref_url = '<a href="'.DOL_URL_ROOT.'/fichinter/fiche.php?id='.$this->id.'">'.$this->ref.'</a>';

View File

@ -58,7 +58,7 @@ $pagenext = $page + 1;
llxHeader();
$sql = "SELECT s.nom,s.rowid as socid, f.ref,".$db->pdate("f.datei")." as dp, f.rowid as fichid, f.fk_statut, f.note, f.duree";
$sql = "SELECT s.nom,s.rowid as socid, f.ref,".$db->pdate("f.datei")." as dp, f.rowid as fichid, f.fk_statut, f.description, f.duree";
if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f ";
if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -100,7 +100,7 @@ if ($result)
print "<tr $bc[$var]>";
print "<td><a href=\"fiche.php?id=".$objp->fichid."\">".img_object($langs->trans("Show"),"task").' '.$objp->ref."</a></td>\n";
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44)."</a></td>\n";
print '<td>'.nl2br($objp->note).'</td>';
print '<td>'.nl2br($objp->description).'</td>';
print '<td align="center">'.dolibarr_print_date($objp->dp)."</td>\n";
print '<td align="right">'.price($objp->duree).'</td>';
print '<td align="right">'.$fichinter_static->LibStatut($objp->fk_statut,5).'</td>';

View File

@ -52,7 +52,7 @@ $offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
$sql = "SELECT s.nom,s.rowid as socid, f.note, f.ref,".$db->pdate("f.datei")." as dp, f.rowid as fichid, f.fk_statut, f.duree";
$sql = "SELECT s.nom,s.rowid as socid, f.description, f.ref,".$db->pdate("f.datei")." as dp, f.rowid as fichid, f.fk_statut, f.duree";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f ";
$sql .= " WHERE f.fk_soc = s.rowid";
@ -123,7 +123,7 @@ if ( $db->query($sql) )
print '<td><a href="rapport.php?socid='.$objp->socid.$filter.'"><img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/filter.png" border="0"></a>&nbsp;';
print "<a href=\"".DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->rowid.$filter."\">".$objp->nom."</a></TD>\n";
}
print '<td>'.nl2br($objp->note).'</td>';
print '<td>'.nl2br($objp->description).'</td>';
print "<td>".strftime("%d %B %Y",$objp->dp)."</td>\n";
print '<td align="center">'.sprintf("%.1f",$objp->duree).'</td>';
$DureeTotal += $objp->duree;

View File

@ -680,4 +680,8 @@ ALTER TABLE `llx_osc_product` ADD UNIQUE KEY `fk_product` (`fk_product`);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (120, 'fichinter','internal', 'INTERREPFOLL', 'Responsable suivi de l\'intervention', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (121, 'fichinter','internal', 'INTERVENING', 'Intervenant', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (130, 'fichinter','external', 'BILLING', 'Contact client facturation intervention', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (131, 'fichinter','external', 'CUSTOMER', 'Contact client suivi de l\'intervention', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (131, 'fichinter','external', 'CUSTOMER', 'Contact client suivi de l\'intervention', 1);
ALTER TABLE llx_fichinter CHANGE note description text DEFAULT NULL;
ALTER TABLE llx_fichinter ADD COLUMN note_private text DEFAULT NULL after description;
ALTER TABLE llx_fichinter ADD COLUMN note_public text DEFAULT NULL after note_prive;

View File

@ -33,7 +33,9 @@ create table llx_fichinter
fk_user_valid integer, -- valideur de la fiche
fk_statut smallint DEFAULT 0,
duree real,
note text,
descrition text,
note_private text,
note_public text
UNIQUE INDEX (ref)
)type=innodb;