Fix: Actions can has no status.
This commit is contained in:
parent
a365a139ea
commit
842c87fc94
@ -107,6 +107,8 @@ if (GETPOST("viewcal") || GETPOST("viewweek") || GETPOST("viewday"))
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
|
$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
|
||||||
llxHeader('',$langs->trans("Agenda"),$help_url);
|
llxHeader('',$langs->trans("Agenda"),$help_url);
|
||||||
|
|
||||||
@ -148,8 +150,8 @@ if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
|
|||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||||
if ($_GET["type"]) $sql.= " AND c.id = ".$_GET["type"];
|
if ($_GET["type"]) $sql.= " AND c.id = ".$_GET["type"];
|
||||||
if ($status == 'done') { $sql.= " AND a.percent = 100"; }
|
if ($status == 'done') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
|
||||||
if ($status == 'todo') { $sql.= " AND a.percent < 100"; }
|
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND percent < 100) OR (a.percent > -1 AND a.datep2 > '".$db->idate($now)."'))"; }
|
||||||
if ($filtera > 0 || $filtert > 0 || $filterd > 0)
|
if ($filtera > 0 || $filtert > 0 || $filterd > 0)
|
||||||
{
|
{
|
||||||
$sql.= " AND (";
|
$sql.= " AND (";
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@ -28,6 +28,7 @@ SuppliersOrdersToProcess=Supplier's orders to process
|
|||||||
StatusOrderCanceledShort=Canceled
|
StatusOrderCanceledShort=Canceled
|
||||||
StatusOrderDraftShort=Draft
|
StatusOrderDraftShort=Draft
|
||||||
StatusOrderValidatedShort=Validated
|
StatusOrderValidatedShort=Validated
|
||||||
|
StatusOrderSentShort=Shipment in process
|
||||||
StatusOrderOnProcessShort=Reception
|
StatusOrderOnProcessShort=Reception
|
||||||
StatusOrderProcessedShort=Processed
|
StatusOrderProcessedShort=Processed
|
||||||
StatusOrderToBillShort=To bill
|
StatusOrderToBillShort=To bill
|
||||||
|
|||||||
@ -29,6 +29,7 @@ StatusOrderCanceledShort=Annulée
|
|||||||
StatusOrderDraftShort=Brouillon
|
StatusOrderDraftShort=Brouillon
|
||||||
StatusOrderValidatedShort=Validée
|
StatusOrderValidatedShort=Validée
|
||||||
StatusOrderOnProcessShort=Réception
|
StatusOrderOnProcessShort=Réception
|
||||||
|
StatusOrderSentShort=Expédition en cours
|
||||||
StatusOrderProcessedShort=Traitée
|
StatusOrderProcessedShort=Traitée
|
||||||
StatusOrderToBillShort=À facturer
|
StatusOrderToBillShort=À facturer
|
||||||
StatusOrderApprovedShort=Approuvée
|
StatusOrderApprovedShort=Approuvée
|
||||||
|
|||||||
@ -119,13 +119,15 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Show actions to do array
|
* Show actions to do array
|
||||||
* \param max Max nb of records
|
* @param max Max nb of records
|
||||||
*/
|
*/
|
||||||
function show_array_actions_to_do($max=5)
|
function show_array_actions_to_do($max=5)
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user, $db, $bc, $socid;
|
global $langs, $conf, $user, $db, $bc, $socid;
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
include_once(DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php');
|
include_once(DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php');
|
||||||
include_once(DOL_DOCUMENT_ROOT.'/societe/class/client.class.php');
|
include_once(DOL_DOCUMENT_ROOT.'/societe/class/client.class.php');
|
||||||
|
|
||||||
@ -137,7 +139,7 @@ function show_array_actions_to_do($max=5)
|
|||||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE c.id = a.fk_action";
|
$sql.= " WHERE c.id = a.fk_action";
|
||||||
$sql.= " AND a.percent < 100";
|
$sql.= " AND ((a.percent >= 0 AND percent < 100) OR (a.percent > -1 AND a.datep2 > '".$db->idate($now)."'))";
|
||||||
$sql.= " AND s.rowid = a.fk_soc";
|
$sql.= " AND s.rowid = a.fk_soc";
|
||||||
$sql.= " AND s.entity = ".$conf->entity;
|
$sql.= " AND s.entity = ".$conf->entity;
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
@ -212,13 +214,15 @@ function show_array_actions_to_do($max=5)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Show last actions array
|
* Show last actions array
|
||||||
\param max Max nb of records
|
* @param max Max nb of records
|
||||||
*/
|
*/
|
||||||
function show_array_last_actions_done($max=5)
|
function show_array_last_actions_done($max=5)
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user, $db, $bc, $socid;
|
global $langs, $conf, $user, $db, $bc, $socid;
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = "SELECT a.id, a.percent, a.datep as da, a.datep2 as da2, a.fk_user_author, a.label,";
|
$sql = "SELECT a.id, a.percent, a.datep as da, a.datep2 as da2, a.fk_user_author, a.label,";
|
||||||
$sql.= " c.code, c.libelle,";
|
$sql.= " c.code, c.libelle,";
|
||||||
$sql.= " s.rowid, s.nom as sname, s.client";
|
$sql.= " s.rowid, s.nom as sname, s.client";
|
||||||
@ -227,7 +231,7 @@ function show_array_last_actions_done($max=5)
|
|||||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE c.id = a.fk_action";
|
$sql.= " WHERE c.id = a.fk_action";
|
||||||
$sql.= " AND a.percent >= 100";
|
$sql.= " AND (a.percent >= 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))";
|
||||||
$sql.= " AND s.rowid = a.fk_soc";
|
$sql.= " AND s.rowid = a.fk_soc";
|
||||||
$sql.= " AND s.entity = ".$conf->entity;
|
$sql.= " AND s.entity = ".$conf->entity;
|
||||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user