TUTOS PHP Cross Reference Groupware Applications

Source: /php/rate/demodata.p3 - 48 lines - 1369 bytes - Text - Print

Description: Copyright 2004 - 2010 by Gero Kohnert

   1  <?php
   2  /**
   3   *  Copyright 2004 - 2010 by Gero Kohnert
   4   *
   5   *  This program is free software; you can redistribute it and/or modify it
   6   *  under the terms of the GNU General Public License as published by the
   7   *  Free Software Foundation; version 2 of the License.
   8   *
   9   *  SVN Info $Id: demodata.p3 6 2011-02-12 22:10:44Z gokohnert $
  10   *  $Author: gokohnert $
  11   *
  12   * Filling in demodata
  13   * this file is simply "sourced" when creating a database and filling in demodata
  14   * @modulegroup rate
  15   * @module demodata
  16   * @package rate
  17   */
  18  
  19  $cnt = 0;
  20  foreach ($demodata as $i => $f) {
  21      if ( ($f->gettype() == "product")
  22           || ($f->gettype() == "task")
  23           || ($f->gettype() == "installation")
  24           || ($f->gettype() == "company")
  25          ) {
  26          $cnt++;
  27          if ($cnt %2) continue;
  28          $x = new rate($this->obj);
  29          $x->creator = &$u[$cnt % $ucnt];
  30          $x->worker = $u[$cnt % $ucnt]->id;
  31          $x->name = "a demo rate [". $cnt ."]";
  32          $x->link_id = $f->id;
  33          $x->ref = $f;
  34          $x->priority = 1;
  35          $x->state = rand(1,3);
  36          $x->role = rand(1,6);
  37          $x->cph = rand(20,90);
  38          $msg .= $x->save();
  39  
  40          acl_raise($x,EVERYBODY,$tutos[modok]);
  41          acl_save($x);
  42          $r .= $lang[$x->getType()].":". $x->getFullName() ."<br />\n";
  43          $demodata[] = &$x;
  44          unset($x);
  45          flush();
  46      }
  47  }
  48  ?>

title

Description

title

Description

title

Description

title

title

Body