Add field color into table of type of events

This commit is contained in:
Laurent Destailleur 2014-09-23 17:54:03 +02:00
parent 7224f64224
commit dd86453020
6 changed files with 29 additions and 9 deletions

View File

@ -133,7 +133,7 @@ $tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libe
$tabsql[3] = "SELECT r.rowid as rowid, r.code_region as code, r.nom as libelle, r.fk_pays as country_id, c.code as country_code, c.label as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE r.fk_pays=c.rowid and c.active=1";
$tabsql[4] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_country";
$tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c";
$tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
$tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.color, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1";
$tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid";
$tabsql[9] = "SELECT code_iso as code, label, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies";
@ -187,7 +187,7 @@ $tabfield[2] = "code,libelle,region_id,region,country"; // "code,libelle,regio
$tabfield[3] = "code,libelle,country_id,country";
$tabfield[4] = "code,label";
$tabfield[5] = "code,label";
$tabfield[6] = "code,libelle,type,position";
$tabfield[6] = "code,libelle,type,color,position";
$tabfield[7] = "code,libelle,country_id,country,accountancy_code,deductible";
$tabfield[8] = "code,libelle,country_id,country";
$tabfield[9] = "code,label,unicode";
@ -214,7 +214,7 @@ $tabfieldvalue[2] = "code,libelle,region"; // "code,libelle,region"
$tabfieldvalue[3] = "code,libelle,country";
$tabfieldvalue[4] = "code,label";
$tabfieldvalue[5] = "code,label";
$tabfieldvalue[6] = "code,libelle,type,position";
$tabfieldvalue[6] = "code,libelle,type,color,position";
$tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible";
$tabfieldvalue[8] = "code,libelle,country";
$tabfieldvalue[9] = "code,label,unicode";
@ -241,7 +241,7 @@ $tabfieldinsert[2] = "code_departement,nom,fk_region";
$tabfieldinsert[3] = "code_region,nom,fk_pays";
$tabfieldinsert[4] = "code,label";
$tabfieldinsert[5] = "code,label";
$tabfieldinsert[6] = "code,libelle,type,position";
$tabfieldinsert[6] = "code,libelle,type,color,position";
$tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code,deductible";
$tabfieldinsert[8] = "code,libelle,fk_country";
$tabfieldinsert[9] = "code_iso,label,unicode";

View File

@ -66,11 +66,12 @@ class ActionComm extends CommonObject
var $usertodo; // Object user of owner
var $userdone; // Object user that did action (deprecated)
var $socid;
var $contactid;
var $societe; // Company linked to action (optional)
var $contact; // Contact linked to action (optional)
var $fk_project; // Id of project (optional)
// Properties for links to other objects
var $fk_element; // Id of record
var $elementtype; // Type of record. This if property ->element of object linked to.

View File

@ -410,6 +410,8 @@ if ($resql)
$event->location=$obj->location;
$event->transparency=$obj->transparency;
$event->socid=$obj->fk_soc;
$event->contactid=$obj->fk_contact;
$event->societe->id=$obj->fk_soc;
$event->contact->id=$obj->fk_contact;
@ -779,7 +781,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
}
//$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd;
// Show rect of event
// Define all rects with event (cases1 is first half hour, cases2 is second half hour)
for ($h = $begin_h; $h < $end_h; $h++)
{
$color = ''; //init
@ -797,12 +799,22 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$busy=$event->transparency;
$cases1[$h][$event->id]['busy']=$busy;
$cases1[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour').' - '.dol_print_date($event->date_end_in_calendar,'dayhour').' - '.$event->label;
$cases1[$h][$event->id]['typecode']=$event->type_code;
if ($event->socid)
{
$cases1[$h][$event->id]['string'].='xxx';
}
}
if ($event->date_start_in_calendar < $c && $dateendtouse > $b)
{
$busy=$event->transparency;
$cases2[$h][$event->id]['busy']=$busy;
$cases2[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour').' - '.dol_print_date($event->date_end_in_calendar,'dayhour').' - '.$event->label;
$cases1[$h][$event->id]['typecode']=$event->type_code;
if ($event->socid)
{
$cases2[$h][$event->id]['string'].='xxx';
}
}
}
else
@ -812,6 +824,8 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$cases2[$h][$event->id]['busy']=$busy;
$cases1[$h][$event->id]['string']=$event->label;
$cases2[$h][$event->id]['string']=$event->label;
$cases1[$h][$event->id]['typecode']=$event->type_code;
$cases2[$h][$event->id]['typecode']=$event->type_code;
break;
}
}

View File

@ -804,8 +804,10 @@ class Form
// Construct $out and $outarray
$out.= '<select id="'.$htmlname.'" class="flat" name="'.$htmlname.'">'."\n";
$textifempty=' ';
if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='&nbsp;';
$textifempty='';
// Do not use textempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
//$textifempty=' ';
//if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
if ($showempty) $out.= '<option value="-1">'.$textifempty.'</option>'."\n";
$num = $this->db->num_rows($resql);

View File

@ -20,6 +20,8 @@
ALTER TABLE llx_bank_account ADD COLUMN fk_user_author integer;
ALTER TABLE llx_c_actioncomm ADD COLUMN color varchar(9);
ALTER TABLE llx_propal ADD COLUMN fk_user_modif integer after fk_user_author;
ALTER TABLE llx_commande ADD COLUMN fk_user_modif integer after fk_user_author;
ALTER TABLE llx_facture ADD COLUMN fk_user_modif integer after fk_user_author;

View File

@ -24,8 +24,9 @@ create table llx_c_actioncomm
code varchar(12) NOT NULL,
type varchar(10) DEFAULT 'system' NOT NULL,
libelle varchar(48) NOT NULL,
module varchar(16) DEFAULT NULL,
module varchar(16) DEFAULT NULL,
active tinyint DEFAULT 1 NOT NULL,
todo tinyint,
color varchar(9),
position integer NOT NULL DEFAULT 0
)ENGINE=innodb;