IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Erreurs PHP avec la fonction include_once


Sujet :

Langage PHP

  1. #1
    Nouveau Candidat au Club
    Femme Profil pro
    Inscrit en
    Juillet 2011
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Tarn et Garonne (Midi Pyrénées)

    Informations professionnelles :
    Secteur : Service public

    Informations forums :
    Inscription : Juillet 2011
    Messages : 4
    Points : 1
    Points
    1
    Par défaut Erreurs PHP avec la fonction include_once
    Bonjour,

    j'ai intallé pour tester en local sur WampServer, une application open source Achievo.
    J'ai voulu ajoutée un module et comme indiqué dans la doc ; il y a 2 lignes de codes à modifier pour indiquer le chemin du dossier racine Achievo.
    Mon arborescence se présente :
    le dossier root pour l'application achievo doit être :
    www/achievo/
    Puis mon module intitulé "ical", doit être situé également à la racine
    www/achievo_module/ical
    Je dois configurer le fichier du module ical (ical.php) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    // Change the config_atkroot so it points to the achievo homedir  
    $config_atkroot = "../achievo/";
    J'ai les erreurs suivantes :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    ( ! ) Warning: include_once(../achievo/atk.inc) [function.include-once]: failed to open stream: No such file or directory in C:\wamp\www\achievo_modules\ical\ical.php on line 16
    Call Stack
    #	Time	Memory	Function	Location
    1	0.0014	513056	{main}( )	..\ical.php:0
     
    ( ! ) Warning: include_once() [function.include]: Failed opening '../achievo/atk.inc' for inclusion (include_path='.;C:\wamp\bin\php\php5.3.5\PEAR') in C:\wamp\www\achievo_modules\ical\ical.php on line 16
    Call Stack
    #	Time	Memory	Function	Location
    1	0.0014	513056	{main}( )	..\ical.php:0
     
    ( ! ) Warning: include_once(../achievo/version.inc) [function.include-once]: failed to open stream: No such file or directory in C:\wamp\www\achievo_modules\ical\ical.php on line 17
    Call Stack
    #	Time	Memory	Function	Location
    1	0.0014	513056	{main}( )	..\ical.php:0
     
    ( ! ) Warning: include_once() [function.include]: Failed opening '../achievo/version.inc' for inclusion (include_path='.;C:\wamp\bin\php\php5.3.5\PEAR') in C:\wamp\www\achievo_modules\ical\ical.php on line 17
    Call Stack
    #	Time	Memory	Function	Location
    1	0.0014	513056	{main}( )	..\ical.php:0
     
    ( ! ) Fatal error: Call to undefined function moduleDir() in C:\wamp\www\achievo_modules\ical\ical.php on line 18
    Call Stack
    #	Time	Memory	Function	Location
    1	0.0014	513056	{main}( )	..\ical.php:0
    Je ne suis pas du tout experte en php et j'ai beaucoup de mal à comprendre la construction des fichiers avec la fonction include.
    Je pense qu'il s'agit d'un problème de chemin d'accès, mais je n'ai pas arrêté de modifier ce chemin et c'est toujours les mêmes erreurs ci-dessus.

    J'ai besoin d'aide d'experts en php.
    Merci par avance pour votre aide.
    Nathalie

  2. #2
    Membre confirmé
    Avatar de provirus
    Homme Profil pro
    Consultant informatique
    Inscrit en
    Février 2009
    Messages
    248
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Canada

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2009
    Messages : 248
    Points : 580
    Points
    580
    Par défaut
    Selon la documentation de include_once:
    Les fichiers sont inclus suivant le chemin du fichier fourni ; si aucun n'est fourni, l'include_path sera vérifié. Si le fichier n'est pas trouvé dans l' include_path, include() vérifiera dans le dossier du script appelant et dans le dossier de travail courant avant d'échouer. L'instruction include() enverra une erreur de type warning si elle ne peut trouver le fichier; ce comportement est différent de require(), qui enverra une erreur de type fatal.
    Ce qui est essayé est donc:
    1. l'include_path + '../achievo/atk.inc'
    2. dossier du script appelant + '../achievo/atk.inc'
    3. dossier de travail courant + '../achievo/atk.inc'


    Pour le premier, ça ne semble pas être dans le include_path.

    Pour le second, cela mènerais à C:\wamp\www\achievo_modules\achievo\atk.inc , ce qui n'est pas valide bien entendu.

    Il te reste plus que le troisième qui est le dossier de travail courant. Tu peux voir c'est quoi en exécutant:

  3. #3
    Membre averti Avatar de sayari.dev
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mai 2010
    Messages
    142
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Mai 2010
    Messages : 142
    Points : 300
    Points
    300
    Par défaut
    Bonjour,

    Normalement et vu ta structure des dossiers, ton $config_atkroot est mal déclaré

    Il doit être assigné à

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    // Change the config_atkroot so it points to the achievo homedir  
    $config_atkroot = "../../achievo/";

  4. #4
    Membre averti Avatar de sayari.dev
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mai 2010
    Messages
    142
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Mai 2010
    Messages : 142
    Points : 300
    Points
    300
    Par défaut
    L'idéal serait de déclarer une constante dans l'index de ton www/achievo

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    DEFINE('ACHIEVO_PATH', dirname(__FILE__));
    pour avoir un chemin absolu pour "une meilleure flexibilité"

    et puis

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    // Change the config_atkroot so it points to the achievo homedir  
    $config_atkroot = ACHIEVO_PATH . DIRECTORY_SEPARATOR;

  5. #5
    Nouveau Candidat au Club
    Femme Profil pro
    Inscrit en
    Juillet 2011
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Tarn et Garonne (Midi Pyrénées)

    Informations professionnelles :
    Secteur : Service public

    Informations forums :
    Inscription : Juillet 2011
    Messages : 4
    Points : 1
    Points
    1
    Par défaut
    Bonjour,
    Merci Provirus et Sayari.dev pour vos réponses rapides.

    Alors déjà j'ai modifié le chemin d'accès :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    12 // Change the config_atkroot so it points to the achievo homedir  
    $config_atkroot = "../../achievo/";
    Voici les erreurs :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    ( ! ) Warning: include_once(./atk/include/initial.inc) [function.include-once]: failed to open stream: No such file or directory in C:\wamp\www\achievo\atk.inc on line 15 
    Call Stack 
    # Time Memory Function Location 
    1 0.0016 512848 {main}( ) ..\ical.php:0 
    2 0.0022 519832 include_once( 'C:\wamp\www\achievo\atk.inc' ) ..\ical.php:16 
     
    ( ! ) Warning: include_once() [function.include]: Failed opening './atk/include/initial.inc' for inclusion (include_path='.;C:\php\pear') in C:\wamp\www\achievo\atk.inc on line 15 
    Call Stack 
    # Time Memory Function Location 
    1 0.0016 512848 {main}( ) ..\ical.php:0 
    2 0.0022 519832 include_once( 'C:\wamp\www\achievo\atk.inc' ) ..\ical.php:16 
     
    ( ! ) Warning: include_once(./version.inc) [function.include-once]: failed to open stream: No such file or directory in C:\wamp\www\achievo_modules\ical\ical.php on line 17 
    Call Stack 
    # Time Memory Function Location 
    1 0.0016 512848 {main}( ) ..\ical.php:0 
     
    ( ! ) Warning: include_once() [function.include]: Failed opening './version.inc' for inclusion (include_path='.;C:\php\pear') in C:\wamp\www\achievo_modules\ical\ical.php on line 17 
    Call Stack 
    # Time Memory Function Location 
    1 0.0016 512848 {main}( ) ..\ical.php:0 
     
    ( ! ) Fatal error: Call to undefined function moduleDir() in C:\wamp\www\achievo_modules\ical\ical.php on line 18 
    Call Stack 
    # Time Memory Function Location 
    1 0.0016 512848 {main}( ) ..\ical.php:0
    Voici pour plus d'info, mon fichier atk.inc et mon fichier du module ical (ical.php)

    atk.inc
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    <?php
      /**
       * ATK Include file.. If you strip out stuff you don't need, you
       * might have some performance improvement.
       * Somethings can't be stripped out.
       */
     
      /**
       * @internal This variable indicates where to get all the includes. Usually,
       *           this is the current dir.
       */
      $config_atkroot = "./";
     
      // Atknode is required. Don't remove it.
      include_once($config_atkroot."atk/include/initial.inc");
     
      // Uniform textbox sizes
      define("TEXT_SMALL", 3);
      define("TEXT_LARGE", 10);
     
      // Some uniform colors
      define("COLOR_WARNING", "#FCAA60");
      define("COLOR_ERROR", "#FF0000");
      define("COLOR_OK", "#00FF00");
     
      // Some uniform recordlist highlight color definitions containing the
      // color which can be used when the mousepointer hovers over a row
      define("COLOR_HIGHLIGHT_WARNING", "#FFCC83");
      define("COLOR_HIGHLIGHT_ERROR", "#FF5555");
      define("COLOR_HIGHLIGHT_OK", "#66FF66");
     
    ?>
    fichier ical.php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    <?php
      //
      // iCal configuration options
      //
      // Change the config_atkroot so it points to the achievo homedir
      // 
     
      $config_atkroot = "../../achievo/";
     
      // The number of months that the events go back
      $monthsback = 1;
      // The number of months that the events go in the future
      $monthsahead = 3;
     
      // below there should be nothing to edit
      include_once($config_atkroot."atk.inc");
      include_once($config_atkroot."version.inc");
      require_once($config_atkroot.moduleDir("ical")."includes/class.iCal.inc.php");
      require_once($config_atkroot.moduleDir("ical")."tools.php");
     
      //include_once("../achievo/atk.inc");
      //include_once("../achievo/version.inc");
      //require_once(moduleDir("ical")."includes/class.iCal.inc.php");
      //require_once(moduleDir("ical")."tools.php");
     
     
      // check achievo version (if g_db exist it's 1.1 or earlier)
      if (is_object($g_db)) { $achievo = 1; } else { $achievo = 0; }
     
      // check if it's a valid user with ID given in URL
      foreach ($_GET as $key => $value) { $iduser=$key; break; }
     
      // Some programs add there own stuff to the URL, so we strip it here if known!
      // 2006-01-12: Yagoon Time adds _ics
      $nontoken = array("_ics");
      $iduser = str_replace($nontoken,"",$iduser);
     
     
      // db instance (depends on version of achievo which one to call)
      if ($achievo==1)
      {
          $db = "atk".atkconfig("database")."query";
      } else {
          $db = &atkGetDb();
          $g_db = $db;
      }
     
      // make query to check if user is known
      if ($achievo==1) $query = new $db();
      else $query = &$db->createQuery();
      $query->addTable('ical_preferences');
      $query->addField('*', ' ', 'ical_preferences');
      $query->addCondition("ical_user_url = '".$iduser."'");
      $querystring = $query->buildSelect(TRUE);
      $user = $g_db->getRows($querystring);
      $userid = $user[0]['ical_user_id'];
     
      // No user is found, check if TOKEN is the standard token
      if (count($user)==0)
      {
        $userToken = decrypt($iduser,atkconfig('auth_accountenableexpression'));  
        $userid = explode(":",$userToken);
     
        if (is_numeric($userid[0]))  
        {
         if ($achievo==1) $query = new $db();
         else $query = &$db->createQuery();
        $query->addTable('person');
        $query->addField('userid as ical_user', ' ', 'person');
        $query->addField('id', ' ', 'person');
        $query->addCondition("person.id = '".$userid[0]."'");
        $querystring = $query->buildSelect(TRUE);
        $user = $g_db->getRows($querystring);
        $userid = $user[0]['id'];
        // Show only the calendar events if no prefs are set!
        $user[0]['ical_events'] = 1;
        }
     
        // NO USER FOR TOKEN show 401
        if (count($user)==0)  
        {
         header('HTTP/1.0 401 Unauthorized');
         die("<h1>You are unauthorized to perform this action</h1>");
        }
      }
     
      // All ready to go!
      if (count($user)>0)
      {
      global $g_db;
     
      $iCal = new iCal('Achievo', 0);
     
      if ($user[0]['ical_events']==1)
      {
        $edate = date('Y-m-d',mktime(12,0,0,date("m")-$monthsback,1,date("Y")));
        $bdate = date('Y-m-d',mktime(12,0,0,date("m")+$monthsahead,1,date("Y")));
     
        if ($achievo==1) $query = new $db();
        else $query = &$db->createQuery();
        $query->addTable('schedule');
        $query->addJoin('schedule_attendee', '', 'schedule_attendee.schedule_id=schedule.id', TRUE);
        $query->addJoin('person', '', 'person.id=schedule_attendee.person_id', TRUE);
        $query->addJoin('person', 'owner', 'owner.id=schedule.owner', TRUE);
        $query->addJoin('schedule_type', 'stype', 'stype.id=schedule.scheduletype', TRUE);
     
        $query->addField('id', ' ', 'schedule');
        $query->addField('startdate', ' ', 'schedule');
        $query->addField('enddate', ' ', 'schedule');
        $query->addField('starttime', ' ', 'schedule');
        $query->addField('endtime', ' ', 'schedule');
        $query->addField('title', ' ', 'schedule');
        $query->addField('description', ' ', 'schedule');
        $query->addField('location', ' ', 'schedule');
        $query->addField('allday', ' ', 'schedule');
        $query->addField('publicitem', ' ', 'schedule');
        $query->addField('owner', ' ', 'schedule');
        $query->addField('status', ' ', 'schedule');
        $query->addField('all_users', ' ', 'schedule');
        $query->addField('description AS stype', '', 'stype');    
        $query->addField('firstname', ' ', 'owner');    
        $query->addField('lastname', ' ', 'owner');    
        $query->addField('email', ' ', 'owner');    
        $query->addField('id AS personid', ' ', 'person');    
        if ($user[0]['ical_only_events_privat']==1) 
        {
        $query->addCondition("schedule.startdate <='$bdate' AND schedule.enddate >= '$edate' AND (schedule.owner='".$user[0]['ical_user']."' OR person.userid='".$user[0]['ical_user']."')");    
        } else {
        $query->addCondition("(schedule.startdate <='$bdate' AND schedule.enddate >= '$edate')
                              OR (schedule.startdate <='$bdate' AND schedule.enddate >= '$edate' AND (schedule.owner='".$user[0]['ical_user']."' OR person.userid='".$user[0]['ical_user']."'))");
        }
        $query->addGroupBy('schedule.id');
        $query->addOrderBy('startdate,starttime');
        $querystring = $query->buildSelect(TRUE);
        $recs = $g_db->getRows($querystring);
     
     
        // Loop thru data
        for ($i=0;$i<count($recs);$i++)
        {
            // Get attendees for event
            $attendees = array();
            $attendee = $g_db->getRows("SELECT DISTINCT person.userid,person.lastname,person.firstname,person.email,person.role FROM schedule_attendee LEFT JOIN person ON person.id=schedule_attendee.person_id WHERE schedule_attendee.schedule_id='".$recs[$i]['id']."'");
            for ($a=0;$a<count($attendee);$a++)
            {
                $attendees[$attendee[$a]['firstname']." ".$attendee[$a]['lastname']]=$attendee[$a]['email'].",3";
            }
            // Get links inside the description
            $links = extractLinks($recs[$i]['description']);
     
            // Only add when event is public or your the owner
            if ($recs[$i]['publicitem']==1 or ($userid==$recs[$i]['owner'] or $userid==$recs[$i]['personid'] and $user[0]['ical_events_privat']==1))
            {
            $organizer = array($recs[$i]['firstname']." ".$recs[$i]['lastname'], $recs[$i]['email']);
     
            $iCal->addEvent($organizer, // SET Organiser for this event
                            ($recs[$i]['allday']=="0" ? timestamp($recs[$i]['startdate'],$recs[$i]['starttime']) : timestamp($recs[$i]['startdate'],"00:00:00",array("0","0","0","0","1","0"))), // Set starttime of event (When its an allday event set it to tommorow 00:00:00)
                           ($recs[$i]['allday']=="0" ? timestamp($recs[$i]['enddate'],$recs[$i]['endtime']) : timestamp($recs[$i]['enddate'],"00:00:00",array("0","0","0","0","1","0"))), // Set endtime of event (When its an allday event set it to tommorow 00:00:00)
                            $recs[$i]['location'], // Set location of the event
                            0, // Set Transparancy (0 = OPAQUE | 1 = TRANSPARENT)
                            array(str_replace("/"," ",$recs[$i]['stype'])), // Set event Categorie
                            preg_replace("/(\r\n|\n|\r)/", " ", str_replace(",","",$recs[$i]['description'])), //Set event description (DSTRIP line breaks, because not all ical programs can handle them!)
                            $recs[$i]['title']." (".$recs[$i]['firstname']." ".$recs[$i]['lastname'].")", // Set title of the event
                            $recs[$i]['publicitem'], // Set kind of class
                            $attendees, // Attendees array(key = attendee name, value = e-mail, role of the attendee [0 = CHAIR | 1 = REQ | 2 = OPT | 3 =NON])
                            1, // Set priority (scale 1 to 9)
                            0, // Set frequency of event (0 = once | 1 = secondly | 2 = minutly | 3 = hourly | 4 = daily | 5 = weekly | 6 = monthly | 7 = yearly) NOTE: is set to 0 for Outlook Compatibility!!
                            ($recs[$i]['allday']=="0" ? 0 : timestamp($recs[$i]['enddate'],$recs[$i]['endtime'])), // set recurrency end ('' = forever | integer = number of times | timestring = explicit date)
                            0, // Set interval for frequency (every 2,3,4 weeks...) NOTE: is set to 0 for Outlook Compatibility!!
                            array(0,1,2,3,4,5,6), // Array with the number of the days the event accures (example: array(0,1,5) = Sunday, Monday, Friday
                            1, // Set startday of the Week (0 = Sunday | 6 = Saturday|1 = Monday)
                            "", // Set exeption dates: Array with timestamps of dates that should not be includes in the recurring event
                            ($user[0]['ical_alarm']=="1" && $starttime>time() ? array(
                                                                                                          0, // Action: 0 = DISPLAY, 1 = EMAIL, (not supported: 2 = AUDIO, 3 = PROCEDURE)
                                                                                                          $user[0]['ical_alarm_time'],  // Trigger: alarm before the event in minutes
                                                                                                          $recs[$i]['title']." (".$recs[$i]['firstname']." ".$recs[$i]['lastname'].")", // Title
                                                                                                          preg_replace("/(\r\n|\n|\r)/", " ", str_replace(",","",$recs[$i]['description'])), // Description
                                                                                                          $attendees, // Array (key = attendee name, value = e-mail, second value = role of the attendee [0 = CHAIR | 1 = REQ | 2 = OPT | 3 =NON])
                                                                                                          5, // Duration between the alarms in minutes
                                                                                                          0  // How often should the alarm be repeated
                                                                                                          ) : "" ), // Set alarm for event
                             ($recs[$i]['status'] == "confirmed" ? ($recs[$i]['status'] == "cancelled" ?  2 : 1) : 0 ), // Set Status of the event
                             $links[0], // Set link for event
                             substr($config_languagefile,0,strpos($config_languagefile,".")), // Set language for event strings
                             $recs[$i]['id'] // Set UID of the event
                             );
            }
        }
      }
     
      if ($user[0]['ical_todo']==1)
      {
        // TODO's from Achievo
        if ($achievo==1) $query = new $db();
        else $query = &$db->createQuery();
        $query->addTable('todo');
     
        $query->addJoin('person', 'assigned_to', 'todo.assigned_to=assigned_to.id', TRUE);
        $query->addJoin('person', 'owner', 'owner.id=todo.owner', TRUE);
        $query->addJoin('project', 'projectid', 'todo.projectid=projectid.id', TRUE);
     
        $query->addField('id', ' ', 'todo');
        $query->addField('lastname', ' ', 'owner');
        $query->addField('firstname', ' ', 'owner');
        $query->addField('email', ' ', 'owner');
        $query->addField('id AS ownerid', ' ', 'owner');
        $query->addField('cellular', ' ', 'owner');
        $query->addField('fax', ' ', 'owner');
        $query->addField('status AS ownerstatus', ' ', 'owner');
        $query->addField('name', ' ', 'projectid');
        $query->addField('id AS projectid', ' ', 'projectid');
        $query->addField('title', ' ', 'todo');
        $query->addField('lastname AS lastname_assigned', ' ', 'assigned_to');
        $query->addField('firstname AS firstname_assigned', ' ', 'assigned_to');
        $query->addField('email AS firstname_email', ' ', 'assigned_to');
        $query->addField('id AS id_assigned', ' ', 'assigned_to');
        $query->addField('cellular AS cellular_assigned', '', 'assigned_to');    
        $query->addField('fax AS fax_assigned', ' ', 'assigned_to');    
        $query->addField('status AS status_assigned', ' ', 'assigned_to');    
        $query->addField('entrydate', ' ', 'todo');    
        $query->addField('duedate', ' ', 'todo');    
        $query->addField('updated', ' ', 'todo');    
        $query->addField('priority', ' ', 'todo');    
        $query->addField('description', ' ', 'todo');
        $query->addField('status', ' ', 'todo');
     
        $query->addCondition("assigned_to='".$userid."' OR todo.owner='".$userid."' AND todo.status NOT IN (5,2)");
     
        $query->addOrderBy('duedate, priority');
        $querystring = $query->buildSelect(TRUE);
        $recs = $g_db->getRows($querystring);
     
        for ($i=0;$i<count($recs);$i++)
        {
     
        $iCal->addToDo(
                   $recs[$i]['title'], // Todo title
                   $recs[$i]['description'], // Todo description  
                               '', // Todo location
                   timestamp($recs[$i]['entrydate']), // Todo Start time / Entry date  
                               '', // Todo duration [not used, but can be the difference between start - end date]
                   timestamp($recs[$i]['duedate']),// Todo End time / Deadline
                               0, // Todo percentage complete [not inluded yet]
                   $recs[$i]['priority'], // Todo priority
                               ($recs[$i]['status']=="1" or $recs[$i]['status']=="3" ? 0 : ($recs[$i]['status']=="2" or $recs[$i]['status']=="4" ? 2 : ($recs[$i]['status']=="5" ? 5 : ''))), //Todo status
                               0,// Todo Class (0 = PRIVATE | 1 = PUBLIC | 2 = CONFIDENTIAL)
                               array($recs[$i]['firstname']." ".$recs[$i]['lastname'], $recs[$i]['email']), // Todo organiser
                               array($recs[$i]['firstname_assigned']." ".$recs[$i]['lastname_assigned'], $recs[$i]['email_assigned'],'3'), // Todo attendees (person who as the todo assigned)
                               array($recs[$i]['name']), // Todo categories
                               timestamp(substr($recs[$i]['updated'],0,10),substr($recs[$i]['updated'],11,18)), // Last modification date/time in unix timestamp
                               ($user[0]['ical_alarm']=="1" ? array(0,$user[0]['ical_alarm_time'],$title, $description, $attendees, 5, $user[0]['ical_alarm_repeat']) : 0), // Todo Alarm
                               0, // Todo frequency
                               '', // Todo recurrency end
                               0, // Todo interval for frequency
                               array(0,1,2,3,4,5,6), // Todo day numbers, array with the number of the days the event accures
                               1, // Startday of the Week
                               "", // Exeption dates: Array with timestamps of dates that should not be includes in the recurring event
                               "", // Todo link
                               substr($config_languagefile,0,strpos($config_languagefile,".")), // Language of the Strings
                   $recs[$i]['id'] // Optional UID for this TODO
                              );
     
        }
      }
     
      // RENDER the file
      $filename = "Calendar_".urlencode($user[0]['ical_user'])."_".date("F_j_Y");
      if (empty($user[0]['ical_format'])) $user[0]['ical_format'] = "ics";
      $iCal->outputFile($user[0]['ical_format'],$filename);
     
     }
     ?>
    Je vais tester les autres réponses que vous m'avez faites.
    Merci et bonne journée
    Nathalie

  6. #6
    Nouveau Candidat au Club
    Femme Profil pro
    Inscrit en
    Juillet 2011
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Tarn et Garonne (Midi Pyrénées)

    Informations professionnelles :
    Secteur : Service public

    Informations forums :
    Inscription : Juillet 2011
    Messages : 4
    Points : 1
    Points
    1
    Par défaut
    pour plus de compréhension, voici l'arborescence de mon application.
    Merci
    Fichiers attachés Fichiers attachés

  7. #7
    Nouveau Candidat au Club
    Femme Profil pro
    Inscrit en
    Juillet 2011
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Tarn et Garonne (Midi Pyrénées)

    Informations professionnelles :
    Secteur : Service public

    Informations forums :
    Inscription : Juillet 2011
    Messages : 4
    Points : 1
    Points
    1
    Par défaut
    je joinds également les fichiers suivants qui sont liés au fichier ical.php

    le fichier atk.inc situé www/achievo/
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    <?php
      /**
       * ATK Include file.. If you strip out stuff you don't need, you
       * might have some performance improvement.
       * Somethings can't be stripped out.
       */
     
      /**
       * @internal This variable indicates where to get all the includes. Usually,
       *           this is the current dir.
       */
      $config_atkroot = "./";
     
      // Atknode is required. Don't remove it.
      include_once($config_atkroot."atk/include/initial.inc");
     
      // Uniform textbox sizes
      define("TEXT_SMALL", 3);
      define("TEXT_LARGE", 10);
     
      // Some uniform colors
      define("COLOR_WARNING", "#FCAA60");
      define("COLOR_ERROR", "#FF0000");
      define("COLOR_OK", "#00FF00");
     
      // Some uniform recordlist highlight color definitions containing the
      // color which can be used when the mousepointer hovers over a row
      define("COLOR_HIGHLIGHT_WARNING", "#FFCC83");
      define("COLOR_HIGHLIGHT_ERROR", "#FF5555");
      define("COLOR_HIGHLIGHT_OK", "#66FF66");
     
    ?>
    Puis le fichier index.php situé à la racine www/achievo
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    <?php
     
      /**
       * @internal includes
       */
      $config_atkroot = "./";
      include_once("atk.inc");
      include_once("atk/atkbrowsertools.inc");
      include_once("achievotools.inc");
      atksession();
      atksecure();
      include "theme.inc";
     
      $theme = &atkinstance('atk.ui.atktheme');
      if (atkconfig("fullscreen"))
      {
        // Fullscreen mode. Use index.php as launcher, and launch app.php fullscreen.
     
        $page = &atkinstance("atk.ui.atkpage");
        $ui = &atkinstance("atk.ui.atkui");
        $theme = &atkinstance("atk.ui.atktheme");
        $output = &atkinstance("atk.ui.atkoutput");
     
        $page->register_style($theme->stylePath("style.css"));
        $page->register_script(atkconfig("atkroot")."atk/javascript/launcher.js");
     
        $content = '<script language="javascript">atkLaunchApp(); </script>';
        $content.= '<br><br><a href="#" onClick="atkLaunchApp()">'.atktext('app_reopen', "atk").'</a> &nbsp; '.
        '<a href="#" onClick="window.close()">'.atktext('app_close', "atk").'</a><br><br>';
     
        $box = $ui->renderBox(array("title"=>atktext("app_launcher"),
        "content"=>$content));
     
        $page->addContent($box);
        $output->output($page->render(atktext('app_launcher'), true));
     
        $output->outputFlush();
      }
      else
      {
        if ($theme->getAttribute('useframes',true))
        {
          // Regular mode. app.php can be included directly.
          include "app.php";
        }
        else
        {
          $user = &atkGetUser();
          $indexpage = &atknew('atk.ui.atkindexpage');
          $indexpage->setUsername(getFullUsername());
          $indexpage->setTitle(getAchievoTitle());
          $indexpage->setTopSearchPiece(getSearchPiece());
          $centerpiece="";
          $centerpiecelinks=array();
          getCenterPiece($centerpiece,$centerpiecelinks);
          $indexpage->setTopCenterPieceLinks($centerpiecelinks);
          if($user["name"]=="administrator")
          {
            $destination = array("atknodetype"=>"pim.pim","atkaction"=>"adminpim");
          }
          else 
          {
            $destination = array("atknodetype"=>"pim.pim","atkaction"=>"pim");
          }
          $indexpage->setDefaultDestination($destination);
          $indexpage->generate();
        }
      }
    ?>
    le fichier initial.inc situé www/achievo/atk/include
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    <?php
      /**
       * This file is part of the Achievo ATK distribution.
       * Detailed copyright and licensing information can be found
       * in the doc/COPYRIGHT and doc/LICENSE files which should be
       * included in the distribution.
       *
       * @package atk
       * @subpackage include
       *
       * @copyright (c)2005 Ibuildings.nl BV
       * @license http://www.achievo.org/atk/licensing ATK Open Source License
       *
       * @version $Revision: 6301 $
       * $Id: initial.inc 6404 2009-06-17 11:26:32Z max $
       */
     
      /** @internal includes */
      require_once($config_atkroot.'atk/include/basics.inc');
      require_once($config_atkroot.'atk/modules/atkmoduletools.inc');
      require_once($config_atkroot.'atk/include/compatibility.inc');
      if (atkconfig('autoload_classes',    true)) require_once($config_atkroot.'atk/include/autoload.inc');
      if (atkconfig('use_atkerrorhandler', true)) require_once($config_atkroot.'atk/include/errorhandler.inc');
      require_once($config_atkroot.'atk/ui/class.atkoutput.inc');
      require_once($config_atkroot.'atk/session/class.atksessionmanager.inc');
      require_once($config_atkroot."atk/utils/class.atkstring.inc");
      require_once($config_atkroot.'atk/include/security.inc');
      require_once($config_atkroot.'atk/include/debugging.inc');
      if (atkconfig('lock_type')!=="") require_once($config_atkroot.'atk/lock/class.atklock.inc');
      atkPreloadModules();
     
    ?>
    Le fichier version.inc est situé à la racine www/achievo

    Le fichier ical.php est situé www/achievo_modules/ical.

    J'ajoute ces précisions car je pense que ces fichiers sont liés entre eux et je ne comprends pas leur structure.
    Merci encore pour votre aide.

Discussions similaires

  1. [PHP 5.3] Lancer un script php avec la fonction exec
    Par Poukie dans le forum Langage
    Réponses: 1
    Dernier message: 04/10/2009, 10h42
  2. [1.x] Erreur incompréhensible : avec la fonction __toString()
    Par Malonix dans le forum Symfony
    Réponses: 3
    Dernier message: 01/07/2009, 12h15
  3. Réponses: 5
    Dernier message: 06/12/2008, 09h32
  4. Erreur PHP avec SimplePie
    Par csseur22 dans le forum Langage
    Réponses: 1
    Dernier message: 18/07/2008, 13h25
  5. erreur LNK2019 avec des fonctions communes.
    Par FamiDoo dans le forum Visual C++
    Réponses: 9
    Dernier message: 31/07/2006, 10h32

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo