public function postInstall() { $tree = Doctrine::getTable('Grouping')->getTree(); $root = new Grouping(); $root->name = 'Root'; $root->locked = true; $root->save(); $tree->createRoot($root); $branches = new Grouping(); $branches->name = "Branches"; $branches->locked = true; $branches->save(); $branches->getNode()->insertAsLastChildOf($root); /* This is sample data. There is no known way to tell if a user wants to install sample data :( foreach (explode(" ","Albany Christchurch Ellerslie Remote") AS $name) { $branch=new Grouping; $branch->name=$name; $branch->save(); $branch->getNode()->insertAsLastChildOf($branches); } // the last branch shows whatever is happening on remotebluebox $branch['plugins']=array('directory'=>array('remote'=>'http://remotebluebox/directory/xmlout')); $branch->save(); } */ }
$l10n->setLanguage($SESSION->lang); //============================================================================================ // Model //============================================================================================ require 'models/grouping.php'; require 'models/cpu.php'; require 'models/mon.php'; require 'models/per.php'; require 'models/key.php'; require 'models/furniture.php'; $cpu = new Cpu(); $mon = new Monitor(); $per = new Peripheral(); $key = new Key(); $furniture = new Furniture(); $equip = new Grouping(); //============================================================================================ // Load the page requested by the user //============================================================================================ if (!isset($_GET['page'])) { $data = $equip->listItems(); for ($i = 0; $i < count($data); $i++) { $z = $equip->countItems($data[$i]['group_id']); $data[$i]['noi'] = $z[0]['count']; } $employees = $equip->listEmployees(); $allCpu = $equip->listcpuUG(); $allMon = $equip->listmonUG(); $allPer = $equip->listperUG(); $allKey = $equip->listkeyUG(); $allFurn = $equip->listfurnUG();
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Grouping the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Grouping::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }