Fix: strict mode holidays
This commit is contained in:
parent
77b9718473
commit
a1c86f52d7
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Roman Ozana <ozana@omdesign.cz>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2006 Roman Ozana <ozana@omdesign.cz>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -28,14 +29,16 @@ class ical
|
||||
var $cal; // Array to save iCalendar parse data
|
||||
var $event_count; // Number of Events
|
||||
var $todo_count; // Number of Todos
|
||||
var $freebusy_count; // Number of Freebusy
|
||||
var $last_key; //Help variable save last key (multiline string)
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function ical()
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -338,7 +341,7 @@ class ical
|
||||
*/
|
||||
function get_event_list()
|
||||
{
|
||||
return $this->cal['VEVENT'];
|
||||
return (! empty($this->cal['VEVENT'])?$this->cal['VEVENT']:'');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -44,7 +44,9 @@ $langs->load("orders");
|
||||
$langs->load("agenda");
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$cancel=GETPOST('cancel','alpha');
|
||||
$backtopage=GETPOST('backtopage','alpha');
|
||||
$contactid=GETPOST('contactid','int');
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid','int');
|
||||
@ -53,6 +55,7 @@ if ($user->societe_id) $socid=$user->societe_id;
|
||||
//$result = restrictedArea($user, 'agenda', $id, 'actioncomm', 'actions', '', 'id');
|
||||
|
||||
$error=GETPOST("error");
|
||||
$mesg='';
|
||||
|
||||
$cactioncomm = new CActionComm($db);
|
||||
$actioncomm = new ActionComm($db);
|
||||
@ -73,12 +76,12 @@ if ($action == 'add_action')
|
||||
else $backtopage=DOL_URL_ROOT.'/comm/action/index.php';
|
||||
}
|
||||
|
||||
if ($_POST["contactid"])
|
||||
if ($contactid)
|
||||
{
|
||||
$result=$contact->fetch($_POST["contactid"]);
|
||||
$result=$contact->fetch($contactid);
|
||||
}
|
||||
|
||||
if ($_POST['cancel'])
|
||||
if ($cancel)
|
||||
{
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
@ -368,7 +371,7 @@ if ($action == 'create')
|
||||
if ($result < 0) dol_print_error($db,$contact->error);
|
||||
}
|
||||
|
||||
if ($conf->use_javascript_ajax)
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
print 'jQuery(document).ready(function () {
|
||||
@ -483,7 +486,7 @@ if ($action == 'create')
|
||||
print '</td></tr>';
|
||||
|
||||
// Location
|
||||
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.$act->location.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.$actioncomm->location.'"></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -494,12 +497,12 @@ if ($action == 'create')
|
||||
// Affected by
|
||||
$var=false;
|
||||
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
|
||||
$form->select_users(GETPOST("affectedto")?GETPOST("affectedto"):($actioncomm->usertodo->id > 0 ? $actioncomm->usertodo : $user),'affectedto',1);
|
||||
$form->select_users(GETPOST("affectedto")?GETPOST("affectedto"):(! empty($actioncomm->usertodo->id) && $actioncomm->usertodo->id > 0 ? $actioncomm->usertodo->id : $user->id),'affectedto',1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Realised by
|
||||
print '<tr><td nowrap>'.$langs->trans("ActionDoneBy").'</td><td>';
|
||||
$form->select_users(GETPOST("doneby")?GETPOST("doneby"):($percent==100?$actioncomm->userdone:0),'doneby',1);
|
||||
$form->select_users(GETPOST("doneby")?GETPOST("doneby"):(! empty($actioncomm->userdone->id) && $percent==100?$actioncomm->userdone->id:0),'doneby',1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -530,16 +533,16 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
// Project
|
||||
if ($conf->projet->enabled)
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
// Projet associe
|
||||
$langs->load("project");
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td>';
|
||||
$numproject=select_projects($societe->id,GETPOST("projectid")?GETPOST("projectid"):$projectid,'projectid');
|
||||
$numproject=select_projects((! empty($societe->id)?$societe->id:0),GETPOST("projectid")?GETPOST("projectid"):'','projectid');
|
||||
if ($numproject==0)
|
||||
{
|
||||
print ' <a href="../../projet/fiche.php?socid='.$societe->id.'&action=create">'.$langs->trans("AddProject").'</a>';
|
||||
print ' <a href="'.DOL_DOCUMENT_ROOT.'/projet/fiche.php?socid='.$societe->id.'&action=create">'.$langs->trans("AddProject").'</a>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -551,7 +554,7 @@ if ($action == 'create')
|
||||
|
||||
// Priority
|
||||
print '<tr><td nowrap>'.$langs->trans("Priority").'</td><td colspan="3">';
|
||||
print '<input type="text" name="priority" value="'.($_POST["priority"]?$_POST["priority"]:($actioncomm->priority?$actioncomm->priority:'')).'" size="5">';
|
||||
print '<input type="text" name="priority" value="'.(GETPOST('priority')?GETPOST('priority'):($actioncomm->priority?$actioncomm->priority:'')).'" size="5">';
|
||||
print '</td></tr>';
|
||||
|
||||
add_row_for_calendar_link();
|
||||
@ -559,7 +562,7 @@ if ($action == 'create')
|
||||
// Description
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
|
||||
$doleditor=new DolEditor('note',($_POST["note"]?$_POST["note"]:$actioncomm->note),'',280,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_7,90);
|
||||
$doleditor=new DolEditor('note',(GETPOST('note')?GETPOST('note'):$actioncomm->note),'',280,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_7,90);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
@ -994,7 +997,8 @@ function add_row_for_calendar_link()
|
||||
$nbtr=0;
|
||||
|
||||
// Lien avec calendrier si module active
|
||||
if ($conf->webcalendar->enabled)
|
||||
// TODO external module
|
||||
if (! empty($conf->webcalendar->enabled))
|
||||
{
|
||||
if ($conf->global->PHPWEBCALENDAR_SYNCRO != 'never')
|
||||
{
|
||||
@ -1026,7 +1030,8 @@ function add_row_for_calendar_link()
|
||||
}
|
||||
}
|
||||
|
||||
if ($conf->phenix->enabled)
|
||||
// TODO external module
|
||||
if (! empty($conf->phenix->enabled))
|
||||
{
|
||||
if ($conf->global->PHPPHENIX_SYNCRO != 'never')
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -75,6 +75,7 @@ $day=GETPOST("day","int")?GETPOST("day","int"):0;
|
||||
$actioncode=GETPOST("actioncode","alpha",3);
|
||||
$pid=GETPOST("projectid","int",3);
|
||||
$status=GETPOST("status");
|
||||
$type=GETPOST("type");
|
||||
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
|
||||
|
||||
if (GETPOST('viewcal')) {
|
||||
@ -138,13 +139,13 @@ if (empty($conf->global->AGENDA_DISABLE_EXT) && $conf->global->AGENDA_EXT_NB > 0
|
||||
while($i < $conf->global->AGENDA_EXT_NB)
|
||||
{
|
||||
$i++;
|
||||
$paramkey='AGENDA_EXT_SRC'.$i;
|
||||
$url=$conf->global->$paramkey;
|
||||
$paramkey='AGENDA_EXT_NAME'.$i;
|
||||
$namecal = $conf->global->$paramkey;
|
||||
$paramkey='AGENDA_EXT_COLOR'.$i;
|
||||
$colorcal = $conf->global->$paramkey;
|
||||
if ($url && $namecal) $listofextcals[]=array('src'=>$url,'name'=>$namecal,'color'=>$colorcal);
|
||||
$source='AGENDA_EXT_SRC'.$i;
|
||||
$name='AGENDA_EXT_NAME'.$i;
|
||||
$color='AGENDA_EXT_COLOR'.$i;
|
||||
if (! empty($conf->global->$source) && ! empty($conf->global->$name))
|
||||
{
|
||||
$listofextcals[]=array('src'=>$conf->global->$source,'name'=>$conf->global->$name,'color'=>$conf->global->$color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,6 +220,7 @@ if ($status == 'done') $title=$langs->trans("DoneActions");
|
||||
if ($status == 'todo') $title=$langs->trans("ToDoActions");
|
||||
|
||||
$param='';
|
||||
$region='';
|
||||
if ($status) $param="&status=".$status;
|
||||
if ($filter) $param.="&filter=".$filter;
|
||||
if ($filtera) $param.="&filtera=".$filtera;
|
||||
@ -228,7 +230,7 @@ if ($socid) $param.="&socid=".$socid;
|
||||
if ($showbirthday) $param.="&showbirthday=1";
|
||||
if ($pid) $param.="&projectid=".$pid;
|
||||
if ($actioncode) $param.="&actioncode=".$actioncode;
|
||||
if (GETPOST("type")) $param.="&type=".GETPOST("type");
|
||||
if ($type) $param.="&type=".$type;
|
||||
if ($action == 'show_day' || $action == 'show_week') $param.='&action='.$action;
|
||||
$param.="&maxprint=".$maxprint;
|
||||
|
||||
@ -340,7 +342,7 @@ else
|
||||
$sql.= " AND datep2 > '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')";
|
||||
$sql.= ')';
|
||||
}
|
||||
if ($_GET["type"]) $sql.= " AND ca.id = ".$_GET["type"];
|
||||
if ($type) $sql.= " AND ca.id = ".$type;
|
||||
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 >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
|
||||
if ($filtera > 0 || $filtert > 0 || $filterd > 0)
|
||||
@ -538,7 +540,7 @@ if (count($listofextcals))
|
||||
$moreicalevents=array();
|
||||
foreach($icalevents as $icalevent)
|
||||
{
|
||||
if (is_array($icalevent['RRULE'])) //repeatable event
|
||||
if (isset($icalevent['RRULE']) && is_array($icalevent['RRULE'])) //repeatable event
|
||||
{
|
||||
//if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
|
||||
//if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow;
|
||||
@ -645,7 +647,7 @@ if (count($listofextcals))
|
||||
// Create a new object action
|
||||
$event=new ActionComm($db);
|
||||
$addevent = false;
|
||||
if ($icalevent['DTSTART;VALUE=DATE']) // fullday event
|
||||
if (isset($icalevent['DTSTART;VALUE=DATE'])) // fullday event
|
||||
{
|
||||
// For full day events, date are also GMT but they wont but converted using tz during output
|
||||
$datestart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1);
|
||||
@ -1073,7 +1075,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
if (! empty($event->societe->id) && ! empty($event->contact->id)) $length=round($length/2);
|
||||
if (! empty($event->societe->id) && $event->societe->id > 0)
|
||||
{
|
||||
if (! is_object($cachethirdparties[$event->societe->id]))
|
||||
if (! isset($cachethirdparties[$event->societe->id]) || ! is_object($cachethirdparties[$event->societe->id]))
|
||||
{
|
||||
$thirdparty=new Societe($db);
|
||||
$thirdparty->fetch($event->societe->id);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -29,7 +29,7 @@ require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/agenda.lib.php");
|
||||
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php");
|
||||
if (! empty($conf->projet->enabled)) require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php");
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("agenda");
|
||||
@ -42,6 +42,7 @@ $day=GETPOST("day",'int');
|
||||
$actioncode=GETPOST("actioncode","alpha",3);
|
||||
$pid=GETPOST("projectid",'int',3);
|
||||
$status=GETPOST("status",'alpha');
|
||||
$type=GETPOST('type');
|
||||
|
||||
$filter=GETPOST("filter",'',3);
|
||||
$filtera = GETPOST("userasked","int",3)?GETPOST("userasked","int",3):GETPOST("filtera","int",3);
|
||||
@ -76,7 +77,7 @@ $result = restrictedArea($user, 'agenda', 0, '', 'myactions');
|
||||
$canedit=1;
|
||||
if (! $user->rights->agenda->myactions->read) accessforbidden();
|
||||
if (! $user->rights->agenda->allactions->read) $canedit=0;
|
||||
if (! $user->rights->agenda->allactions->read || $_GET["filter"]=='mine') // If no permission to see all, we show only affected to me
|
||||
if (! $user->rights->agenda->allactions->read || $filter=='mine') // If no permission to see all, we show only affected to me
|
||||
{
|
||||
$filtera=$user->id;
|
||||
$filtert=$user->id;
|
||||
@ -141,7 +142,7 @@ if ($filterd) $param.="&filterd=".$filterd;
|
||||
if ($socid) $param.="&socid=".$socid;
|
||||
if ($showbirthday) $param.="&showbirthday=1";
|
||||
if ($pid) $param.="&projectid=".$pid;
|
||||
if ($_GET["type"]) $param.="&type=".$_REQUEST["type"];
|
||||
if ($type) $param.="&type=".$type;
|
||||
|
||||
$sql = "SELECT s.nom as societe, s.rowid as socid, s.client,";
|
||||
$sql.= " a.id, a.datep as dp, a.datep2 as dp2,";
|
||||
@ -168,7 +169,7 @@ if ($actioncode) $sql.=" AND c.code='".$db->escape($actioncode)."'";
|
||||
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 ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
if ($_GET["type"]) $sql.= " AND c.id = ".$_GET["type"];
|
||||
if ($type) $sql.= " AND c.id = ".$type;
|
||||
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 >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
|
||||
if ($filtera > 0 || $filtert > 0 || $filterd > 0)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -21,7 +21,7 @@
|
||||
/**
|
||||
* \file htdocs/comm/action/rapport/index.php
|
||||
* \ingroup commercial
|
||||
* \brief Page with reports of actions $
|
||||
* \brief Page with reports of actions
|
||||
*/
|
||||
|
||||
require("../../../main.inc.php");
|
||||
@ -30,6 +30,15 @@ require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/action/rapport.pdf.php");
|
||||
|
||||
$langs->load("commercial");
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$month=GETPOST('month');
|
||||
$year=GETPOST('year');
|
||||
|
||||
$mesg='';
|
||||
$mesgs=array();
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
@ -44,15 +53,13 @@ $socid = GETPOST('socid','int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'agenda', $socid, '', 'myactions');
|
||||
|
||||
$langs->load("commercial");
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
if ($_GET["action"] == 'builddoc')
|
||||
if ($action == 'builddoc')
|
||||
{
|
||||
$cat = new CommActionRapport($db, $_GET["month"], $_GET["year"]);
|
||||
$cat = new CommActionRapport($db, $month, $year);
|
||||
$result=$cat->write_file(GETPOST('id','int'));
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -89,7 +96,7 @@ if ($resql)
|
||||
|
||||
print_barre_liste($langs->trans("Actions"), $page, "index.php",'',$sortfield,$sortorder,'',$num);
|
||||
|
||||
if ($mesg) print $mesg.'<br>';
|
||||
dol_htmloutput_mesg($mesg,$mesgs);
|
||||
|
||||
$i = 0;
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user