Fix: Migrate requests to delete orphelins

This commit is contained in:
Laurent Destailleur 2011-07-22 13:46:34 +00:00
parent 904263e5f0
commit a826242609
3 changed files with 26 additions and 27 deletions

View File

@ -24,7 +24,7 @@
* \file htdocs/comm/action/index.php * \file htdocs/comm/action/index.php
* \ingroup agenda * \ingroup agenda
* \brief Home page of calendar events * \brief Home page of calendar events
* \version $Id$ * \version $Id: index.php,v 1.183 2011/07/22 06:51:31 simnandez Exp $
*/ */
require("../../main.inc.php"); require("../../main.inc.php");
@ -487,24 +487,23 @@ if ($showbirthday)
//Exernal Calendars //Exernal Calendars
$listofextcals=array(); $listofextcals=array();
if ($conf->global->MAIN_FEATURES_LEVEL>=2)
if (empty($conf->global->AGENDA_DISABLE_EXT) && $conf->global->AGENDA_EXT_NB > 0)
{ {
if (empty($conf->global->AGENDA_DISABLE_EXT) && $conf->global->AGENDA_EXT_NB > 0) $i=0;
{ while($i < $conf->global->AGENDA_EXT_NB)
$i=0; {
while($i < $conf->global->AGENDA_EXT_NB) $i++;
{ $paramkey='AGENDA_EXT_SRC'.$i;
$i++; $url=$conf->global->$paramkey;
$paramkey='AGENDA_EXT_SRC'.$i; $paramkey='AGENDA_EXT_NAME'.$i;
$url=$conf->global->$paramkey; $namecal = $conf->global->$paramkey;
$paramkey='AGENDA_EXT_NAME'.$i; $paramkey='AGENDA_EXT_COLOR'.$i;
$namecal = $conf->global->$paramkey; $colorcal = $conf->global->$paramkey;
$paramkey='AGENDA_EXT_COLOR'.$i; if ($url && $namecal) $listofextcals[]=array('src'=>$url,'name'=>$namecal,'color'=>$colorcal);
$colorcal = $conf->global->$paramkey; }
if ($url && $namecal) $listofextcals[]=array('src'=>$url,'name'=>$namecal,'color'=>$colorcal);
}
}
} }
if (sizeof($listofextcals)) if (sizeof($listofextcals))
{ {
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/ical.class.php"); require_once(DOL_DOCUMENT_ROOT."/comm/action/class/ical.class.php");
@ -787,7 +786,7 @@ $("#actionagenda_vcal_link").attr("href","/public/agenda/agendaexport.php?format
'; ';
*/ */
llxFooter('$Date$ - $Revision$'); llxFooter('$Date: 2011/07/22 06:51:31 $ - $Revision: 1.183 $');
/** /**

View File

@ -1,5 +1,5 @@
-- --
-- $Id: 3.0.0-3.1.0.sql,v 1.79 2011/07/12 22:12:12 eldy Exp $ -- $Id: 3.0.0-3.1.0.sql,v 1.80 2011/07/22 13:46:34 eldy Exp $
-- --
-- Be carefull to requests order. -- Be carefull to requests order.
-- This file must be loaded by calling /install/index.php page -- This file must be loaded by calling /install/index.php page
@ -124,7 +124,9 @@ ALTER TABLE llx_usergroup_user DROP INDEX fk_user;
ALTER TABLE llx_usergroup_user DROP INDEX uk_user_group_entity; ALTER TABLE llx_usergroup_user DROP INDEX uk_user_group_entity;
ALTER TABLE llx_usergroup_user ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; ALTER TABLE llx_usergroup_user ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;
ALTER TABLE llx_usergroup_user ADD UNIQUE INDEX uk_usergroup_user (entity,fk_user,fk_usergroup); ALTER TABLE llx_usergroup_user ADD UNIQUE INDEX uk_usergroup_user (entity,fk_user,fk_usergroup);
-- V4.1 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
ALTER TABLE llx_usergroup_user ADD CONSTRAINT fk_usergroup_user_fk_user FOREIGN KEY (fk_user) REFERENCES llx_user (rowid); ALTER TABLE llx_usergroup_user ADD CONSTRAINT fk_usergroup_user_fk_user FOREIGN KEY (fk_user) REFERENCES llx_user (rowid);
-- V4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
ALTER TABLE llx_usergroup_user ADD CONSTRAINT fk_usergroup_user_fk_usergroup FOREIGN KEY (fk_usergroup) REFERENCES llx_usergroup (rowid); ALTER TABLE llx_usergroup_user ADD CONSTRAINT fk_usergroup_user_fk_usergroup FOREIGN KEY (fk_usergroup) REFERENCES llx_usergroup (rowid);
ALTER TABLE llx_commande ADD COLUMN ref_int varchar(30) AFTER ref_ext; ALTER TABLE llx_commande ADD COLUMN ref_int varchar(30) AFTER ref_ext;

View File

@ -22,7 +22,7 @@
/** /**
* \file htdocs/lib/agenda.lib.php * \file htdocs/lib/agenda.lib.php
* \brief Set of function for the agenda module * \brief Set of function for the agenda module
* \version $Id$ * \version $Id: agenda.lib.php,v 1.42 2011/07/22 06:51:30 simnandez Exp $
*/ */
@ -324,13 +324,11 @@ function agenda_prepare_head()
$head[$h][2] = 'xcal'; $head[$h][2] = 'xcal';
$h++; $h++;
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // In dev version only for the moment $head[$h][0] = DOL_URL_ROOT."/admin/agenda_extsites.php";
{ $head[$h][1] = $langs->trans("ExtSites");
$head[$h][0] = DOL_URL_ROOT."/admin/agenda_extsites.php"; $head[$h][2] = 'extsites';
$head[$h][1] = $langs->trans("ExtSites"); $h++;
$head[$h][2] = 'extsites';
$h++;
}
return $head; return $head;
} }