Merge branch 'develop_dolibarr' into develop

This commit is contained in:
Peter Fontaine 2013-10-15 17:19:08 +02:00
commit 60b78ac41e
4 changed files with 26 additions and 18 deletions

View File

@ -82,7 +82,7 @@ $pid=GETPOST("projectid","int",3);
$status=GETPOST("status"); $status=GETPOST("status");
$type=GETPOST("type"); $type=GETPOST("type");
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); $maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=="0"?'':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':''));
if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week') { if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week') {
$action='show_month'; $day=''; $action='show_month'; $day='';
@ -236,7 +236,7 @@ if ($filterd) $param.="&filterd=".$filterd;
if ($socid) $param.="&socid=".$socid; if ($socid) $param.="&socid=".$socid;
if ($showbirthday) $param.="&showbirthday=1"; if ($showbirthday) $param.="&showbirthday=1";
if ($pid) $param.="&projectid=".$pid; if ($pid) $param.="&projectid=".$pid;
if ($actioncode) $param.="&actioncode=".$actioncode; if ($actioncode != '') $param.="&actioncode=".$actioncode;
if ($type) $param.="&type=".$type; if ($type) $param.="&type=".$type;
if ($action == 'show_day' || $action == 'show_week') $param.='&action='.$action; if ($action == 'show_day' || $action == 'show_week') $param.='&action='.$action;
$param.="&maxprint=".$maxprint; $param.="&maxprint=".$maxprint;
@ -382,10 +382,10 @@ if ($resql)
$event->type_code=$obj->code; $event->type_code=$obj->code;
$event->libelle=$obj->label; $event->libelle=$obj->label;
$event->percentage=$obj->percent; $event->percentage=$obj->percent;
$event->author->id=$obj->fk_user_author; $event->author->id=$obj->fk_user_author; // user id of creator
$event->usertodo->id=$obj->fk_user_action; $event->usertodo->id=$obj->fk_user_action; // user id of owner
$event->userdone->id=$obj->fk_user_done; $event->userdone->id=$obj->fk_user_done; // deprecated
// $event->userstodo=... with s after user, in future version, will be an array with all id of user assigned to event
$event->priority=$obj->priority; $event->priority=$obj->priority;
$event->fulldayevent=$obj->fulldayevent; $event->fulldayevent=$obj->fulldayevent;
$event->location=$obj->location; $event->location=$obj->location;
@ -952,11 +952,10 @@ llxFooter();
function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60) function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60)
{ {
global $user, $conf, $langs; global $user, $conf, $langs;
global $filter, $filtera, $filtert, $filterd, $status; global $filter, $filtera, $filtert, $filterd, $status, $actioncode; // Filters used into search form
global $theme_datacolor; global $theme_datacolor;
global $cachethirdparties, $cachecontacts, $colorindexused; global $cachethirdparties, $cachecontacts, $colorindexused;
print '<div id="dayevent_'.sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day).'" class="dayevent">'."\n"; print '<div id="dayevent_'.sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day).'" class="dayevent">'."\n";
$curtime = dol_mktime(0, 0, 0, $month, $day, $year); $curtime = dol_mktime(0, 0, 0, $month, $day, $year);
print '<table class="nobordernopadding" width="100%">'; print '<table class="nobordernopadding" width="100%">';
@ -1009,6 +1008,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|| (! empty($event->userdone->id) && $event->userdone->id == $user->id)) || (! empty($event->userdone->id) && $event->userdone->id == $user->id))
{ {
$nummytasks++; $cssclass='family_mytasks'; $nummytasks++; $cssclass='family_mytasks';
// TODO Set a color using user color
// Must defined rule to choose color of who to use.
// event->usertodo->id will still contains user id of owner
// event->userstodo will be an array in future.
// $color=$user->color;
} }
else if ($event->type_code == 'ICALEVENT') else if ($event->type_code == 'ICALEVENT')
{ {
@ -1179,9 +1183,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
} }
else else
{ {
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?maxprint=0&month='.$monthshown.'&year='.$year; print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?maxprint=0&month='.$monthshown.'&year='.$year;
print ($status?'&status='.$status:'').($filter?'&filter='.$filter:''); print ($status?'&status='.$status:'').($filter?'&filter='.$filter:'');
print ($filtera?'&filtera='.$filtera:'').($filtert?'&filtert='.$filtert:'').($filterd?'&filterd='.$filterd:''); print ($filtera?'&filtera='.$filtera:'').($filtert?'&filtert='.$filtert:'').($filterd?'&filterd='.$filterd:'');
print ($actioncode!=''?'&actioncode='.$actioncode:'');
print '">'.img_picto("all","1downarrow_selected.png").' ...'; print '">'.img_picto("all","1downarrow_selected.png").' ...';
print ' +'.(count($eventarray[$daykey])-$maxprint); print ' +'.(count($eventarray[$daykey])-$maxprint);
print '</a>'; print '</a>';

View File

@ -32,21 +32,23 @@ create table llx_actioncomm
fk_action integer, -- type of action (optionnal link with llx_c_actioncomm or null) fk_action integer, -- type of action (optionnal link with llx_c_actioncomm or null)
code varchar(32) NULL, -- code of action for automatic action code varchar(32) NULL, -- code of action for automatic action
label varchar(128) NOT NULL, -- libelle de l'action label varchar(128) NOT NULL, -- label/title of event
datec datetime, -- date creation datec datetime, -- date creation
tms timestamp, -- date modif tms timestamp, -- date modification
fk_user_author integer, -- id user qui a cree l'action fk_user_author integer, -- user id of user that has created record
fk_user_mod integer, -- id dernier user qui a modifier l'action fk_user_mod integer, -- user id of user that has modified record
fk_project integer, fk_project integer,
fk_soc integer, fk_soc integer,
fk_contact integer, fk_contact integer,
fk_parent integer NOT NULL default 0, fk_parent integer NOT NULL default 0,
fk_user_action integer, -- id de la personne qui doit effectuer l'action fk_user_action integer, -- user id of owner of action (currently also user id of actor that must do action. In future, actors assigned to action will be an array into table llx_actioncomm_actors)
transparency integer, -- transparency (ical standard). used to say if people assigned to event are busy or not by event.
fk_user_done integer, -- id de la personne qui a effectue l'action transparency integer, -- transparency (ical standard). used to say if people assigned to event are busy or not by event (in future version, this field is deprecated and will be stored into table llx_actioncomm_actors)
fk_user_done integer, -- user id of people that has made action (deprecated)
priority smallint, priority smallint,
fulldayevent smallint NOT NULL default 0, fulldayevent smallint NOT NULL default 0,
punctual smallint NOT NULL default 1, punctual smallint NOT NULL default 1,

View File

@ -621,7 +621,7 @@ class Product extends CommonObject
} }
// Delete all child tables // Delete all child tables
$elements = array('product_fournisseur_price','product_price','product_lang','categorie_product'); $elements = array('product_fournisseur_price','product_price','product_lang','categorie_product','product_stock');
foreach($elements as $table) foreach($elements as $table)
{ {
if (! $error) if (! $error)
@ -644,7 +644,7 @@ class Product extends CommonObject
{ {
$sqlz = "DELETE FROM ".MAIN_DB_PREFIX."product"; $sqlz = "DELETE FROM ".MAIN_DB_PREFIX."product";
$sqlz.= " WHERE rowid = ".$id; $sqlz.= " WHERE rowid = ".$id;
dol_syslog(get_class($this).'::delete sql='.$sql, LOG_DEBUG); dol_syslog(get_class($this).'::delete sql='.$sqlz, LOG_DEBUG);
$resultz = $this->db->query($sqlz); $resultz = $this->db->query($sqlz);
if ( ! $resultz ) if ( ! $resultz )
{ {

View File

@ -61,6 +61,7 @@ class MouvementStock
{ {
global $conf, $langs; global $conf, $langs;
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$error = 0; $error = 0;
dol_syslog(get_class($this)."::_create start userid=$user->id, fk_product=$fk_product, warehouse=$entrepot_id, qty=$qty, type=$type, price=$price label=$label"); dol_syslog(get_class($this)."::_create start userid=$user->id, fk_product=$fk_product, warehouse=$entrepot_id, qty=$qty, type=$type, price=$price label=$label");