コード例 #1
0
 public static function createOrUpdateDistantParams(EiProjet $ei_project, EiProfil $ei_profile, KalFunction $kal_function, $data, Doctrine_Connection $conn = null)
 {
     if ($conn == null) {
         $conn = Doctrine_Manager::connection();
     }
     try {
         $conn->beginTransaction();
         //Début de la transaction
         //Appel du webservice
         $result_update = MyFunction::loadResultOfWebServiceByPostJson(MyFunction::getPrefixPath(null) . "/serviceweb/project/parameter/createOrUpdate.json", array('project_id' => $ei_project->getProjectId(), 'project_ref' => $ei_project->getRefId(), 'profile_id' => $ei_profile->getProfileId(), 'profile_ref' => $ei_profile->getProfileRef(), 'function_id' => $kal_function->getFunctionId(), 'function_ref' => $kal_function->getFunctionRef(), 'data' => $data));
         $array_result = json_decode(html_entity_decode($result_update), true);
         //Récupération du paramètre pour traitement
         if (count($array_result) == 0) {
             return false;
         }
         if (array_key_exists("error", $array_result)) {
             return false;
         }
         if (!$array_result[0]) {
             return false;
         }
         //Rechargement d'un paramètre
         self::reload($array_result, $conn);
         $conn->commit();
         return $array_result[0]['fp_id'];
     } catch (Exception $e) {
         $conn->rollback();
         return false;
         throw $e;
     }
 }
コード例 #2
0
 public function createAssignmentHistory(EiSubjectAssignment $assignment, $is_assignment = true, Doctrine_Connection $conn = null)
 {
     if ($conn == null) {
         $conn = Doctrine_Manager::connection();
     }
     return $conn->insert($this->getInstance(), array('author_of_assignment' => MyFunction::getGuard()->getId(), 'subject_id' => $assignment->getSubjectId(), 'assign_to' => $assignment->getGuardId(), 'date' => date("Y-m-d H:i:s"), 'is_assignment' => $is_assignment));
 }
コード例 #3
0
 public function execute($arguments = array(), $options = array())
 {
     $databaseManager = new sfDatabaseManager(sfProjectConfiguration::getApplicationConfiguration('frontend', $options['env'], true));
     $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', $options['env'], true);
     sfContext::createInstance($configuration);
     $conn = Doctrine_Manager::connection();
     // Récupération de toutes les notices.
     $noeuds = $conn->execute("SELECT id, name FROM ei_data_set_structure;");
     $this->log('Récupération des noeuds...OK');
     // Création de la requête permettant
     $this->log('Création de la requête de mise à jour...');
     $requeteToUpdate = "UPDATE ei_data_set_structure SET slug = #{NEW_SLUG} WHERE id = #{NODE_ID};";
     $requeteGlobale = array();
     foreach ($noeuds->fetchAll() as $noeud) {
         // Remplacement SLUG.
         $tmpRequete = str_replace("#{NEW_SLUG}", $conn->quote(MyFunction::sluggifyForXML($noeud["name"])), $requeteToUpdate);
         // Remplacement ID.
         $tmpRequete = str_replace("#{NODE_ID}", $noeud["id"], $tmpRequete);
         // Ajout dans la requête globale.
         $requeteGlobale[] = $tmpRequete;
     }
     // Préparation de la requête.
     $this->log("Préparation de la requête...");
     $requete = implode(" ", $requeteGlobale);
     try {
         // Exécution de la requête.
         $this->log("Exécution de la requête...");
         $conn->execute($requete);
         // Fin.
         $this->log("Processus terminé avec succès.");
     } catch (Exception $exc) {
         $this->log($exc->getMessage());
     }
 }
コード例 #4
0
ファイル: EiView.class.php プロジェクト: lendji4000/compose
 public static function createDistantView(EiProjet $ei_project, EiTree $ei_parent_tree, $data, Doctrine_Connection $conn = null)
 {
     $result_file = new DOMDocument();
     if ($conn == null) {
         $conn = Doctrine_Manager::connection();
     }
     try {
         $conn->beginTransaction();
         //Début de la transaction
         //$result_file = new DOMDocument();
         //Appel du webservice
         $result_update = MyFunction::loadResultOfWebServiceByPostJson(MyFunction::getPrefixPath(null) . "/serviceweb/project/view/create.json", array('project_id' => $ei_project->getProjectId(), 'project_ref' => $ei_project->getRefId(), 'parent_id' => $ei_parent_tree->getId(), 'data' => $data));
         $array_result = json_decode(html_entity_decode($result_update), true);
         //Récupération de la vue  pour traitement
         if (count($array_result) == 0) {
             return false;
         }
         if (array_key_exists("error", $array_result)) {
             return false;
         }
         if (!$array_result[0]) {
             return false;
         }
         //Rechargement d'une vuew
         EiView::reload($array_result, $conn);
         $conn->commit();
         return true;
     } catch (Exception $e) {
         $conn->rollback();
         //return false;
         throw $e;
     }
 }
コード例 #5
0
 /**
  * Permet de définir si le formulaire de paramètre pour les jeux de données est valide ou non.
  *
  * @param type $values
  * @return type
  * @throws sfValidatorErrorSchema 
  */
 protected function doClean($values)
 {
     $errorSchema = new sfValidatorErrorSchema($this);
     $name = MyFunction::sluggifyForXML($values['name']);
     $id = isset($values["id"]) ? $values["id"] : -1;
     if ($this->str->getEiDatasetStructureParentId()) {
         /** @var Doctrine_Collection $existing */
         $existing = Doctrine_Core::getTable('EiDataSetStructure')->findByEiDatasetStructureParentIdAndSlug($this->str->getEiDatasetStructureParentId(), $name);
         /** @var EiDataSetStructure $node */
         foreach ($existing as $key => $node) {
             if ($node->getId() == $id) {
                 $existing->remove($key);
             }
         }
     } else {
         $existing = Doctrine_Core::getTable('EiDataSetStructure')->findByEiDatasetStructureParentIdAndSlug("is null", $name);
     }
     if ($existing->count() > 0 && $this->isNew || $existing->count() >= 1 && !$this->isNew) {
         $errorSchema->addError(new sfValidatorError($this, 'name'), 'name');
     }
     // si l'on a trouvé des erreurs, alors on transmet une exception
     if (count($errorSchema)) {
         throw new sfValidatorErrorSchema($this, $errorSchema);
     }
     return $values;
 }
コード例 #6
0
 public static function createDistantNoticeLang($version_notice_id, $notice_id, $notice_ref, $lang, Doctrine_Connection $conn = null)
 {
     if ($conn == null) {
         $conn = Doctrine_Manager::connection();
     }
     try {
         $conn->beginTransaction();
         //Début de la transaction
         //Appel du webservice
         $result_service = MyFunction::loadResultOfWebServiceByPostJson(MyFunction::getPrefixPath(null) . "serviceweb/createNoticeVersion.json", array('version_notice_id' => $version_notice_id, 'notice_id' => $notice_id, 'notice_ref' => $notice_ref, 'lang' => $lang));
         //Récupération de la nouvelle langue de notice pour traitement
         $array_result = json_decode(html_entity_decode($result_service), true);
         if (count($array_result) == 0) {
             return array("success" => false, "message" => "Error on transaction");
         }
         if (array_key_exists("error", $array_result)) {
             return array("success" => false, "message" => $array_result["error"]);
         }
         if (!$array_result[0]) {
             return array("success" => false, "message" => "Empty result content");
         }
         self::reload($array_result, $conn);
         $conn->commit();
         return Doctrine_Core::getTable("EiVersionNotice")->findOneByVersionNoticeIdAndNoticeIdAndNoticeRefAndLang($version_notice_id, $notice_id, $notice_ref, $lang);
     } catch (Exception $e) {
         $conn->rollback();
         throw $e;
         return false;
     }
 }
コード例 #7
0
ファイル: EiTicket.class.php プロジェクト: lendji4000/compose
 public static function createDistantPackage(EiProjet $ei_project, $data, Doctrine_Connection $conn = null)
 {
     if ($conn == null) {
         $conn = Doctrine_Manager::connection();
     }
     try {
         $conn->beginTransaction();
         //Début de la transaction
         $result_file = new DOMDocument();
         //Appel du webservice
         $result_update = MyFunction::loadResultOfWebServiceByPostJson(MyFunction::getPrefixPath(null) . "serviceweb/project/package/create.json", array('project_id' => $ei_project->getProjectId(), 'project_ref' => $ei_project->getRefId(), 'data' => $data));
         //Récupération du ticket pour traitement
         $array_result = json_decode(html_entity_decode($result_update), true);
         //throw new Exception(html_entity_decode($result_update));
         //Récupération du projet pour traitement
         if (count($array_result) == 0) {
             return false;
         }
         if (array_key_exists("error", $array_result)) {
             return false;
         }
         if (!$array_result[0]) {
             return false;
         }
         EiTicket::reload($array_result, $conn);
         $conn->commit();
         return array('package_id' => $array_result[0]['t_id'], 'package_ref' => $array_result[0]['t_ref']);
     } catch (Exception $e) {
         $conn->rollback();
         throw $e;
         return false;
     }
 }
コード例 #8
0
 /**
  * @param DOMDocument $documentXsd
  * @param DOMElement $container
  * @return DOMElement
  */
 public function generateXSD($documentXsd = null, $container = null)
 {
     // Création de l'élément XML relatif au noeud.
     $element = MyFunction::generateXSDElement($documentXsd, array("name" => $this->getXMLTag()));
     // On récupère le noeud où inserer les noeuds fils.
     $insertIn = $element->firstChild->firstChild;
     /** @var EiLeafDataSet $leaf */
     foreach ($this->getLeaves() as $leaf) {
         // On génère l'élément XSD relatif à la feuille.
         $leafElement = $leaf->generateXSD($documentXsd);
         $insertIn->appendChild($leafElement);
     }
     // On crée la séquences de noeuds fils.
     $sequence = $documentXsd->createElement("xs:sequence");
     $sequence->setAttribute('minOccurs', 0);
     $sequence->setAttribute('maxOccurs', "unbounded");
     // On parcours les fils.
     /** @var EiNodeDataSet $child */
     foreach ($this->getChildren() as $child) {
         // On génère l'élément XSD relatif au noeud fils.
         $childElement = $child->generateXSD($documentXsd, $element);
         // Puis on l'insert dans la séquence.
         $sequence->appendChild($childElement);
     }
     // On insert ensuite la séquence.
     $insertIn->appendChild($sequence);
     if ($container == null) {
         $documentXsd->appendChild($element);
     } else {
         $container->appendChild($element);
     }
     return $element;
 }
コード例 #9
0
 /**
  * Retourne la structure sous-forme d'objet DOM.
  *
  * @param $root
  * @return DOMDocument
  */
 public static function createXSD($root)
 {
     // Création du schéma XSD.
     $schema = MyFunction::createSchemaXSD($documentXsd);
     $rootElement = $root->generateXSD($documentXsd);
     $schema->appendChild($rootElement);
     return $documentXsd;
 }
コード例 #10
0
 public function getPackage(Doctrine_Connection $conn = null)
 {
     $conn2 = Doctrine_Manager::connection();
     $conn2->execute("update ei_subject s left join ei_ticket t \n                            on s.package_id =t.ticket_id and s.package_ref=t.ticket_ref\n                            set s.package_id =NULL and s.package_ref=NULL\n                            where CONCAT('Package_S',s.id)!=t.name");
     $conn2->execute("update ei_subject s  left join ei_ticket t on s.package_id=t.ticket_id and s.package_ref=t.ticket_ref\n            set package_id=NULL , package_ref=NULL \n            where   t.ticket_id IS   NULL OR   t.ticket_ref is   NULL ");
     if ($conn == null) {
         $conn = Doctrine_Manager::connection();
     }
     /* Le package existe déjà mais on procède aux vérifications permettant d'avoir l'unicité d'un bug pour un package.
         En effet un Package doit être lié à un bug au plus.
        */
     if ($this->getPackageId() != null && $this->getPackageId() != 0 && $this->getPackageRef() != null && $this->getPackageRef() != 0) {
         $package_bugs_links = $conn->fetchAll("select t.ticket_id , t.ticket_ref, s.id  \n                        from  ei_ticket t \n                        inner join  ei_subject s on s.package_id=t.ticket_id and s.package_ref=t.ticket_ref\n                        where t.ticket_id= " . $this->getPackageId() . " and t.ticket_ref=" . $this->getPackageRef());
     } else {
         $package_bugs_links = array();
     }
     if (count($package_bugs_links) == 0) {
         //Le ticket du bug est null ou n'existe pas : on le crée par le web service
         //Si le package du bug est   null
         if ($this->getPackageId() != null && $this->getPackageRef() != null) {
             $conn->execute("update ei_subject set package_id=NULL And package_ref=NULL where package_id=" . $this->getPackageId() . " And package_ref=" . $this->getPackageRef());
         }
         /* On recharge le projet si nécessaire */
         $ei_project = $this->getEiProject();
         if ($ei_project->needsReload()) {
             $xml = $ei_project->downloadKalFonctions();
             if ($xml != null) {
                 $ei_project->transactionToLoadObjectsOfProject($xml);
             }
         }
         /* Préparation des données de création du web service de création de l'intervention */
         $guard = MyFunction::getGuard();
         $data = array('package_name' => 'Package_S' . $this->getId(), 'guard_id' => $guard->getId());
         /* Création de l'intervention */
         $pack = EiTicket::createDistantPackage($this->getEiProject(), json_encode($data));
         if (is_array($pack) && isset($pack['package_id']) && isset($pack['package_ref'])) {
             return array("package_id" => $pack['package_id'], "package_ref" => $pack['package_ref']);
         } else {
             //Echec de la création de l'intervention du bug.
             throw new Exception("Fatal error . Failed to create  intervention package! Contact administrator...");
             //$conn->execute("update ei_subject set package_id=" . $pack['package_id'] . " , package_ref=" . $pack['package_ref'] . " , updated_at='" . date('Y-m-d H:i:s') . "' where id=" . $this->getId());
             //$package = Doctrine_Core::getTable('EiTicket')->findOneByTicketIdAndTicketRef($pack['package_id'], $pack['package_ref']);
         }
     } elseif (count($package_bugs_links) > 1) {
         //Le ticket est lié à plusieurs bugs : On génère une exception et on alerte l'administrateur
         throw new Exception("Fatal error . Many interventions for a package! Contact administrator...");
     } else {
         //Le package du bug/intervention est bien définit et l'objet EiTicket associé existe.
         return array("package_id" => $this->getPackageId(), "package_ref" => $this->getPackageRef());
     }
 }
コード例 #11
0
ファイル: actions.class.php プロジェクト: lendji4000/compose
 public function executeSignin(sfWebRequest $request)
 {
     $login = $request->getParameter('login');
     $pwd = $request->getParameter('pwd');
     if ($login != null && $pwd != null) {
         try {
             $result_connect = MyFunction::connexionDistante($login, $pwd);
             //Si le fichier est vide
             if ($result_connect == null) {
                 throw new Exception('Empty File . Contact administrator');
             }
         } catch (Exception $e) {
             $this->getUser()->setFlash('error_connexion', $e->getMessage());
             $this->redirect('@homepage');
         }
         if (is_array($result_connect)) {
             $guard_tab = $result_connect['guard_tab'];
             //On vérifie que l'utilisateur n'est pas désactivé coté script
             if ($guard_tab['is_active'] != 1) {
                 $this->getUser()->setFlash('error_connexion', sprintf('Inactive user . Contact administrator to no more about'));
                 $this->redirect('@homepage');
             }
             $ei_user_tab = $result_connect['ei_user_tab'];
             $guard_user = Doctrine_Core::getTable("sfGuardUser")->findOneBy('username', $guard_tab['username']);
             /*
              * Si l'utilisateur se connecte pour la premiere fois 
              * ou s'il n'est pas enregistré , on le crée 
              */
             if (!$guard_user || $guard_user == null) {
                 $guard_user = Doctrine_Core::getTable('sfGuardUser')->createUser($guard_tab, $ei_user_tab);
             }
             $this->getUser()->setAttribute('user_id', $guard_user->getId(), 'sfGuardSecurityUser');
             $this->getUser()->setAuthenticated(true);
             $this->getUser()->setFlash('valid_connexion', sprintf('connexion accepted'));
             //$this->redirect('@recharger_projet');
             $signinUrl = $request->getReferer();
             return $this->redirect('' != $signinUrl ? $signinUrl : '@homepage');
         } else {
             if ($result_connect == null) {
                 $this->getUser()->setFlash('error_connexion', sprintf('Connexion error , unexpected raison ... Contact administrator'));
             } else {
                 $this->getUser()->setFlash('error_connexion', sprintf($result_connect));
             }
             $this->redirect('@homepage');
         }
     } else {
         $this->getUser()->setFlash('error_connexion', sprintf('Empty fields.'));
     }
     return $this->redirect('@homepage');
 }
コード例 #12
0
ファイル: actions.class.php プロジェクト: lendji4000/compose
 /**
  * Méthode appelée avant chaque appel d'action.
  */
 public function preExecute()
 {
     /** @var EiUserTable $table */
     $table = Doctrine_Core::getTable('EiUser');
     $this->token = $this->getRequest()->getParameter("token");
     $this->user = $table::getInstance()->getUserByTokenApi($this->token);
     $this->forward404If(is_bool($this->user) && $this->user === false, "You are not allowed to access this page.");
     // On récupère le nom d'utilisateur ainsi que le mot de passe pour les intéractions avec script.
     $this->login = $this->user->getGuardUser()->getUsername();
     // On authentifie l'utilisateur s'il ne l'est pas.
     if (MyFunction::getGuard() == null) {
         $this->getUser()->signIn($this->user->getGuardUser(), true);
     }
 }
コード例 #13
0
 /**
  * Permet de définir si le formulaire de paramètre pour les versions est valide ou non
  * @param type $values
  * @return type
  * @throws sfValidatorErrorSchema 
  */
 protected function doClean($values)
 {
     $errorSchema = new sfValidatorErrorSchema($this);
     $name = MyFunction::sluggifyForXML($values['name']);
     try {
         $tag = new DOMElement($name);
     } catch (Exception $e) {
         $errorSchema->addError(new sfValidatorError($this, 'name'), 'name');
     }
     // si l'on a trouvé des erreurs, alors on transmet une exception
     if (count($errorSchema)) {
         throw new sfValidatorErrorSchema($this, $errorSchema);
     }
     return $values;
 }
コード例 #14
0
 /**
  * Permet de définir si le formulaire de paramètre pour les versions est valide ou non
  * @param type $values
  * @return type
  * @throws sfValidatorErrorSchema 
  */
 protected function doClean($values)
 {
     $errorSchema = new sfValidatorErrorSchema($this);
     $name = MyFunction::sluggifyForXML($values['name']);
     $id = isset($values["id"]) ? $values["id"] : -1;
     /** @var EiVersionStructureTable $tableVersionStr */
     $tableVersionStr = Doctrine_Core::getTable("EiVersionStructure");
     if ($this->str->getEiVersionStructureParentId()) {
         $existing = $tableVersionStr->findByEiVersionStructureParentIdAndSlug($this->str->getEiVersionStructureParentId(), $name);
         /** @var Doctrine_Collection $existing */
         if ($existing->count() > 0 && $this->isNew == false) {
             // On retire l'élément si présent dans la liste.
             foreach ($existing as $key => $elt) {
                 if ($elt->getId() == $this->str->getId()) {
                     $existing->remove($key);
                 }
             }
         }
     } else {
         $existing = $tableVersionStr->findByEiVersionStructureParentIdAndSlug("is null", $name);
     }
     $count = $existing->count();
     if ($count > 0 && $this->isNew || $count >= 1 && !$this->isNew) {
         $errorSchema->addError(new sfValidatorError($this, 'name'), 'name');
     }
     // ON VERIFIE S'IL S'AGIT D'UN BLOC FOREACH QU'UN NOEUD SOIT RENSEIGNE.
     if ($this->str instanceof EiBlockForeach) {
         if (isset($values["Iterator"]) && $values["Iterator"] != null && isset($values["Iterator"]["ei_dataset_structure_id"])) {
             $idNode = $values["Iterator"]["ei_dataset_structure_id"];
             /** @var EiNodeDataSet $node */
             $node = Doctrine_Core::getTable("EiNodeDataSet")->find($idNode);
             if (!$node) {
                 $errorSchema->addError(new sfValidatorError($this, 'iterator_invalid'), 'iterator');
             } elseif (!($node->getType() == EiDataSetStructure::$TYPE_NODE && !$node->isRoot())) {
                 $errorSchema->addError(new sfValidatorError($this, 'iterator_type_invalid'), 'iterator');
             }
         } else {
             $errorSchema->addError(new sfValidatorError($this, 'iterator_empty'), 'iterator');
         }
     }
     // si l'on a trouvé des erreurs, alors on transmet une exception
     if (count($errorSchema)) {
         throw new sfValidatorErrorSchema($this, $errorSchema);
     }
     return $values;
 }
コード例 #15
0
 function checkIfDefaultPackageExist($validator, $values, $arguments)
 {
     if (!$this->getObject()->isNew()) {
         return $values;
     }
     // C'est n 'est pas un nouveau scénario , on retourne les valeurs du formulaire
     //On récupère l'utilisateur courant
     $ei_user = MyFunction::getGuard()->getEiUser();
     $defPack = Doctrine_Core::getTable('EiUserDefaultPackage')->findOneByProjectIdAndProjectRefAndUserIdAndUserRef($values['project_id'], $values['project_ref'], $ei_user->getUserId(), $ei_user->getRefId());
     if ($defPack != null) {
         //On et la propriété défaultPackage du scénario pour la sauvegarde de sa version par défaut
         $this->getObject()->setDefaultPackage($defPack);
         return $values;
         //Le package par défaut existe
     }
     throw new sfValidatorError($validator, 'You have to select package before create à test suite ...');
     return $values;
 }
コード例 #16
0
 /**
  * Action permettant de retourner la description et les notices d'une fonction.
  * En POST, le matching est directement réalisé.
  *
  * @param sfWebRequest $request
  */
 public function execute($request)
 {
     $this->setLayout(false);
     // On détermine le type de contenu retourné.
     $this->getResponse()->setContentType('application/json');
     $this->getUser()->signIn($this->user, true);
     // Récupération du JDT.
     $test_set_id = $request->getParameter("ei_test_set_id");
     $testSet = Doctrine_Core::getTable('EiTestSet')->find($test_set_id);
     // Récupération de la fonction.
     $function_id = $request->getParameter("function_id");
     $function_ref = $request->getParameter("function_ref");
     // Récupération du projet.
     $project_id = $request->getParameter("project_id");
     $project_ref = $request->getParameter("project_ref");
     $project = Doctrine_Core::getTable('EiProjet')->findOneByProjectIdAndRefId($project_id, $project_ref);
     // Récupération du profil.
     $profile_id = $request->getParameter("profile_id");
     $profile_ref = $request->getParameter("profile_ref");
     /** @var EiProfil $profile */
     $profile = Doctrine_Core::getTable('EiProfil')->findOneByProfileIdAndProfileRefAndProjectIdAndProjectRef($profile_id, $profile_ref, $project_id, $project_ref);
     //Recherche des paramètres de profil à utiliser pour interpreter des éventuels paramètres variables
     $profileParams = $profile->getParamsWithName($this->user->getEiUser());
     //Récupération de l'oracle du jeu de test ( notice  du jeu de test)
     $oracle = $testSet->getTestSetOracle($project, $project->getDefaultNoticeLang(), $function_id, $function_ref, false);
     $oracle = isset($oracle[0]) ? $oracle[0] : $oracle;
     // Récupération des paramètres d'entrée.
     $params = Doctrine_Core::getTable('EiTestSetParam')->getParamForTestSetAndEiTestFunction($test_set_id, $oracle['ei_test_set_function_id']);
     $paramsOut = Doctrine_Core::getTable('EiFunctionHasParam')->findByFunctionRefAndFunctionIdAndParamType($function_ref, $function_id, 'OUT');
     // Transformation de la notice
     $noticeDesc = MyFunction::parseAndExtractParamsValue($oracle["description"], $params, $profileParams);
     $noticeExp = MyFunction::parseAndExtractParamsValue($oracle["expected"], $params, $profileParams);
     if ($paramsOut != null && $paramsOut->count() > 0) {
         $tmpParams = array();
         /** @var EiFunctionHasParam $param */
         foreach ($paramsOut as $param) {
             $tmpParams[] = array("name" => $param->getName(), "value" => $param->getDefaultValue());
         }
         $paramsOut = $tmpParams;
     } else {
         $paramsOut = array();
     }
     return $this->renderText(json_encode(array("func_desc" => $oracle["func_desc"], "notice_desc" => $noticeDesc, "notice_expected" => $noticeExp, "in_params" => $params, 'out_params' => $paramsOut)));
 }
コード例 #17
0
ファイル: _arboTree.php プロジェクト: lendji4000/compose
            ?>
" data-stats="<?php 
            echo $url_link;
            ?>
"  
           class="  <?php 
            if ($tree_child['type'] == 'Function') {
                echo "pop {$class_action}";
            }
            ?>
"   title="<?php 
            echo $tree_child['name'];
            ?>
"  >
               <?php 
            echo MyFunction::troncatedText($tree_child['name'], 40);
            ?>
        </a>
        <?php 
            $functionNodeDetailsUri = $urlParams;
            $functionNodeDetailsUri['tree_type'] = $tree_child['type'];
            $functionNodeDetailsUri['ei_tree_id'] = $tree_child['id'];
            $functionNodeDetailsUri['obj_id'] = $tree_child['obj_id'];
            $functionNodeDetailsUri['ref_obj'] = $tree_child['ref_obj'];
            ?>
        <a href="#" itemref="<?php 
            echo url_for2('functionNodeDetails', $functionNodeDetailsUri);
            ?>
" class="nodeMoreInf" style="visibility: hidden;"><i class="fa fa-lg fa-info-circle"></i></a>
        <a class="add_script_folder add_node_child" title="Create a new folder" alt="New Folder"  style="visibility: hidden;"
           href="<?php 
コード例 #18
0
ファイル: oracleSuccess.php プロジェクト: lendji4000/compose
 ?>
         </td>
         <td>
             <?php 
 $ch1 = MyFunction::parseAndExtractParamsValue($notice['final_expected'], $params, $profileParams);
 ?>
             <?php 
 echo MyFunction::parseAndExtractOutParamsValue($ch1, $paramsOut);
 ?>
         </td>
         <td>
             <?php 
 $ch1 = MyFunction::parseAndExtractParamsValue($notice['final_result'], $params, $profileParams);
 ?>
             <?php 
 echo MyFunction::parseAndExtractOutParamsValue($ch1, $paramsOut);
 ?>
         </td>
         <td>
             <?php 
 $selLogs = explode("///", $notice["sel_logs"]);
 ?>
             <ul>
                 <?php 
 foreach ($selLogs as $selLog) {
     ?>
                     <?php 
     $haveError = preg_match("/\\[error\\]/", $selLog);
     ?>
                     <?php 
     $haveComment = preg_match("/\\[comment\\]/", $selLog);
コード例 #19
0
ファイル: _nodeLine.php プロジェクト: lendji4000/compose
<?php

$url_tab = array('project_id' => $project_id, 'project_ref' => $project_ref, 'profile_id' => $profile_id, 'profile_ref' => $profile_ref, 'profile_name' => $profile_name);
?>
 

<?php 
$tab = MyFunction::getPathToTreeNode($ei_node, $url_tab);
$img_node = $tab['img_node'];
$path_to_node = $tab['path_to_node'];
$isOpen = false;
$openHidden = "";
$closeHidden = "eisge-hidden";
if (isset($opened_ei_nodes)) {
    foreach ($opened_ei_nodes as $i => $node) {
        if ($node->getEiNodeId() == $ei_node->getId()) {
            $isOpen = true;
            $openHidden = "eisge-hidden";
            $closeHidden = "";
            break;
        }
    }
}
?>

<li class="item_tree">
    <ul>
        <li class="lien_survol_node">     
            <input type="hidden" name="obj_id" value="<?php 
echo $ei_node->getObjId();
?>
コード例 #20
0
ファイル: EiProjet.class.php プロジェクト: lendji4000/compose
 public function ChargerFonctions($xmlfile, Doctrine_Connection $conn = null)
 {
     /* Tous les objets vont etre recharger sur le projet courant. 
      * Du coup on récupère l'id et le ref du projet
      */
     $project_id = $this->getProjectId();
     $project_ref = $this->getRefId();
     if ($conn == null) {
         $conn = Doctrine_Manager::connection();
     }
     $dom = new DomDocument();
     if ($xmlfile != null) {
         $dom->loadXML($xmlfile);
         $dom->save('projet.xml');
         /* A utiliser en cas de deboguage pour visualiser le contenu du fichier */
         //recherche de l'element racine <projets>
         if ($dom->documentElement) {
             $projets = $dom->documentElement;
             //rechargement des données du projet
             //si le projet a été trouvé
             if ($projets->getElementsByTagName("info")->item(0)) {
                 MyFunction::rechargerProjet($projets->getElementsByTagName("info")->item(0), true, $conn);
                 //Création des tables temporaires pour opérations d'insert - delete
                 //Table temporaire des fonctions
                 Doctrine_Core::getTable('ScriptEiFunction')->insertTmpData($projets, $project_id, $project_ref, $conn);
                 //Table temporaire des dossiers de fonctions (EiView)
                 Doctrine_Core::getTable('ScriptEiView')->insertTmpData($projets, $project_id, $project_ref, $conn);
                 //Table temporaire des scripts
                 Doctrine_Core::getTable('ScriptEiScript')->insertTmpData($projets, $project_id, $project_ref, $conn);
                 //Table temporaire des relations script-profil
                 Doctrine_Core::getTable('ScriptEiScriptVersion')->insertTmpData($projets, $project_id, $project_ref, $conn);
                 //Table temporaire des notices
                 Doctrine_Core::getTable('ScriptEiNotice')->insertTmpData($projets, $project_id, $project_ref, $conn);
                 //Table temporaire des profils de notice
                 Doctrine_Core::getTable('ScriptEiNoticeProfil')->insertTmpData($projets, $project_id, $project_ref, $conn);
                 //Table temporaire des versions de notice
                 Doctrine_Core::getTable('ScriptEiVersionNotice')->insertTmpData($projets, $project_id, $project_ref, $conn);
                 //Rechargement des relations version_notice-profil du projet
                 Doctrine_Core::getTable('EiNoticeProfil')->reload($projets, $project_id, $project_ref, $conn);
                 //Rechargement des  versions de notice d'un projet
                 Doctrine_Core::getTable('EiVersionNotice')->reload($projets, $project_id, $project_ref, $conn);
                 //Rechargement des  notice d'un projet
                 //$this->getNotices()->delete($conn);
                 Doctrine_Core::getTable('EiNotice')->reload($projets, $project_id, $project_ref, $conn);
                 //Rechargement des liaisons utilisateurs-tickets
                 $this->getUserTickets()->delete($conn);
                 //Doctrine_Core::getTable('EiUserTicket')->deleteUserTicketForProject($project_id, $project_ref , $conn);
                 Doctrine_Core::getTable('EiUserTicket')->reload($projets, $project_id, $project_ref, $conn);
                 //Rechargement des paramètres de profil
                 //$this->getProjectProfileParams()->delete($conn);
                 Doctrine_Core::getTable('EiProfileParam')->deleteProjectProfileParams($project_id, $project_ref, $conn);
                 Doctrine_Core::getTable('EiProfileParam')->reload($projets, $project_id, $project_ref, $conn);
                 //Rechargement des paramètres d'une fonction
                 Doctrine_Core::getTable('EiFunctionHasParam')->reload($projets, $project_id, $project_ref, $conn);
                 //Rechargement des liaisons script-profil des fonctions d'un projet
                 Doctrine_Core::getTable('EiScriptVersion')->reload($projets, $project_id, $project_ref, $conn);
                 //Rechargement des scripts de fonction
                 Doctrine_Core::getTable('EiScript')->reload($projets, $project_id, $project_ref, $conn);
                 //Rechargement des fonctions (KalFunction pour ne pas créer d'ambiguité avec EiFonction)
                 Doctrine_Core::getTable('KalFunction')->reload($projets, $project_id, $project_ref, $conn);
                 //Rechargement des commandes de fonction d'un projet
                 Doctrine_Core::getTable('EiFunctionHasCommande')->reload($projets, $project_id, $project_ref, $conn);
                 //Rechargement des vues du projet
                 //Doctrine_Core::getTable('EiView')->deleteProjectViews($project_id, $project_ref , $conn);
                 Doctrine_Core::getTable('EiView')->reload($projets, $project_id, $project_ref, $conn);
                 //Rechargement des profils
                 //Doctrine_Core::getTable('EiProfil')->deleteProjectProfiles($project_id, $project_ref , $conn );
                 Doctrine_Core::getTable('EiProfil')->reload($projets, $project_id, $project_ref, $conn);
                 //Rechargement des tickets
                 Doctrine_Core::getTable('EiTicket')->deleteProjectTickets($project_id, $project_ref, $conn);
                 Doctrine_Core::getTable('EiTicket')->reload($projets, $project_id, $project_ref, $conn);
                 //récupération des noeuds ouverts pour les garder ouverts.
                 $nodes = $this->getAllProjectNodes();
                 $openNodes = array();
                 foreach ($nodes as $i => $n) {
                     $opened = $n->getEiTreeOpenedByUsers();
                     if ($opened->count() > 0) {
                         $openNodes[$n->getId()] = $opened;
                     }
                 }
                 //Doctrine_Core::getTable('EiTree')->deleteProjectNodes($project_id, $project_ref ,$conn);
                 //Rechargement de l'arbre
                 Doctrine_Core::getTable('EiTree')->reload($projets, $project_id, $project_ref, $conn, $openNodes);
                 //Rechargement des langues du projet
                 Doctrine_Core::getTable('EiProjectLang')->deleteProjectLangs($project_id, $project_ref, $conn);
                 Doctrine_Core::getTable('EiProjectLang')->reload($projets, $project_id, $project_ref, $conn);
                 //Rechargement des paramètres globaux du projet
                 Doctrine_Core::getTable('EiProjectParam')->deleteProjectParams($project_id, $project_ref, $conn);
                 Doctrine_Core::getTable('EiProjectParam')->reload($projets, $project_id, $project_ref, $conn);
                 //Suppression des fonctions inactives
                 Doctrine_Core::getTable('KalFunction')->deleteInactiveFunctions($this, $conn);
                 //Création des status par défaut du projet
                 $this->createDefaultStates($conn);
             }
         } else {
             $d = date('Y-m-d H:i:s');
             $this->setObsolete(true);
             $this->setCheckedAt($d);
             $this->save();
         }
     }
     return null;
 }
コード例 #21
0
 public static function connexionDistante($login_user, $pwd_user)
 {
     if ($pwd_user == null) {
         return null;
     }
     //Appel du webservice
     $xml = ServicesWeb::loadResultOfWebService(MyFunction::getPrefixPath() . "en/serviceweb/connexionDistante?login="******"&pwd=" . $pwd_user . "&system_uri=" . sfConfig::get('project_system_uri') . "&sf_format=xml");
     $dom = new DOMDocument();
     $dom->loadXML($xml);
     $dom->save('login.xml');
     if (!$dom->documentElement) {
         return null;
     }
     if ($dom->documentElement->nodeName == 'error') {
         return $dom->documentElement->nodeValue;
     }
     if ($dom->documentElement && $dom->documentElement->getElementsByTagName("guard_user")) {
         $u = $dom->documentElement->getElementsByTagName("guard_user")->item(0);
         if ($u->getElementsByTagName("username") && $u->getAttribute("id")) {
             $id = $u->getAttribute("id");
             $username = $u->getElementsByTagName("username")->item(0)->nodeValue;
             $first_name = $u->getElementsByTagName("first_name")->item(0)->nodeValue;
             $last_name = $u->getElementsByTagName("last_name")->item(0)->nodeValue;
             $email_address = $u->getElementsByTagName("email_address")->item(0)->nodeValue;
             $company = $u->getElementsByTagName("company")->item(0)->nodeValue;
             $password = $u->getElementsByTagName("password")->item(0)->nodeValue;
             $is_active = $u->getElementsByTagName("is_active")->item(0)->nodeValue;
             $guard_tab = array('id' => $id, 'username' => $username, 'first_name' => $first_name, 'company' => $company, 'last_name' => $last_name, 'email_address' => $email_address, 'password' => $password, 'is_active' => $is_active);
         }
         $user = $dom->documentElement->getElementsByTagName("ei_user")->item(0);
         if ($user->getElementsByTagName("ref_id") && $user->getElementsByTagName("user_id")) {
             $user_id = $user->getAttribute("user_id");
             $ref_id = $user->getAttribute("ref_id");
             $guard_id = $user->getElementsByTagName("guard_id")->item(0)->nodeValue;
             $matricule = $user->getElementsByTagName("matricule")->item(0)->nodeValue;
             $ei_user_tab = array('user_id' => $user_id, 'ref_id' => $ref_id, 'guard_id' => $guard_id, 'matricule' => $matricule);
         }
         return array('guard_tab' => $guard_tab, 'ei_user_tab' => $ei_user_tab);
     } else {
         throw new Exception('Impossible de se connecter à ' . MyFunction::getPrefixPath());
     }
     return null;
 }
コード例 #22
0
 public function checkProfile(sfWebRequest $request, EiProjet $ei_project, $setProfileSession = true)
 {
     $this->profile_id = $request->getParameter('profile_id');
     $this->profile_ref = $request->getParameter('profile_ref');
     if ($this->profile_id != null && $this->profile_ref != null) {
         //Recherche du profil en base
         $this->ei_profile = Doctrine_Core::getTable('EiProfil')->findOneByProfileIdAndProfileRefAndProjectIdAndProjectRef($this->profile_id, $this->profile_ref, $ei_project->getProjectId(), $ei_project->getRefId());
         //Si la fonction n'existe pas , alors on retourne null
         if ($this->ei_profile == null) {
             $this->ei_profile = null;
         } else {
             if ($setProfileSession) {
                 //Si l'utilisateur décide de mettre le profil recherché en session
                 $this->setProfileSession($this->ei_profile->getName(), $this->profile_id, $this->profile_ref);
             }
             $this->profile_name = MyFunction::sluggifyStr($this->ei_profile->getName());
             //Définition du tableau de paramètres basique pour les différents objets
             $this->urlParameters = array('project_id' => $ei_project->getProjectId(), 'project_ref' => $ei_project->getRefId(), 'profile_id' => $this->profile_id, 'profile_ref' => $this->profile_ref, 'profile_name' => $this->profile_name);
         }
     } else {
         $this->profile_id = null;
         $this->profile_ref = null;
     }
 }
コード例 #23
0
ファイル: actions.class.php プロジェクト: lendji4000/compose
 public function executeUpdate(sfWebRequest $request)
 {
     $this->checkProject($request);
     //Récupération du projet
     $this->checkProfile($request, $this->ei_project);
     //Récupération du profil courant
     $this->checkCampaignGraph($request);
     $this->ei_campaign = $this->ei_campaign_graph->getCampaign($this->project_id, $this->project_ref);
     if ($this->ei_campaign == null) {
         $this->forward404('Campaign not found');
     }
     $this->form = new EiCampaignGraphForm($this->ei_campaign_graph, array('ei_project' => $this->ei_project));
     $this->processForm($request, $this->form);
     if ($this->success) {
         $this->campaignGraphBlockType = Doctrine_Core::getTable('EiBlockType')->findAll();
         $downloadCampaignNodeAttachment = $this->urlParameters;
         $downloadCampaignNodeAttachment['campaign_id'] = $this->ei_campaign_graph->getCampaignId();
         $downloadCampaignNodeAttachment['id'] = $this->campaign_graph_id;
         return $this->renderText(json_encode(array('html' => $this->ei_campaign_graph->getFilename() != null ? $this->generateUrl('downloadCampaignNodeAttachment', $downloadCampaignNodeAttachment) : '#', 'filename' => $this->ei_campaign_graph->getFilename() != null ? MyFunction::troncatedText($this->ei_campaign_graph->getFilename(), 17) : '', 'updateMode' => true, 'step_id' => $this->campaign_graph_id, 'success' => true)));
     } else {
         $uri_form = $this->urlParameters;
         $uri_form['form'] = $this->form;
         $uri_form['ei_nodes'] = $this->ei_nodes;
         $uri_form['campaign_id'] = $this->campaign_id;
         $uri_form['root_folder'] = $this->root_folder;
         $uri_form['parent_id'] = $this->parent_id;
         return $this->renderText(json_encode(array('html' => $this->getPartial('eicampaigngraph/form', $uri_form), 'success' => false)));
     }
     return sfView::NONE;
 }
コード例 #24
0
<?php

$url_tab = array('project_id' => $project_id, 'project_ref' => $project_ref, 'profile_id' => $profile_id, 'profile_ref' => $profile_ref, 'profile_name' => $profile_name);
$title = MyFunction::troncatedText($ei_project, 17);
$originalTitle = $ei_project;
include_partial('global/sideBarCurrentObject', array('title' => $title, 'icon' => 'ei_project', 'originalTitle' => $originalTitle, 'dataContent' => ''));
?>
 


<!--Livraisons ouvertes-->

<?php 
include_partial('global/openDeliveries', array('openDeliveries' => $openDeliveries, 'delivery_show_uri' => $url_tab));
?>
 
 
コード例 #25
0
 public function save(Doctrine_Connection $conn = null)
 {
     $this->setSlug(MyFunction::sluggifyForXML($this->getName()));
     parent::save($conn);
     // TODO: Change the autogenerated stub
 }
コード例 #26
0
">
                 
                <a href="#deliverySearchBoxForSteps"    data-toggle="modal" id="openDeliverySearchBoxForSteps">
                    <?php 
echo ei_icon('ei_delivery') . '&nbsp; ' . (isset($ei_delivery) && $ei_delivery != null ? MyFunction::troncatedText($ei_delivery, 10) : '');
?>
  
                </a>  
            </li>
            <li class="<?php 
echo isset($ei_subject) && $ei_subject != null ? 'active col-lg-4 col-md-4' : 'col-lg-4 col-md-4';
?>
">
                <a href="#subjectSearchBoxForSteps"  data-toggle="modal" id="openSubjectSearchBoxForSteps">
                    <?php 
echo ei_icon('ei_subject') . '&nbsp;' . (isset($ei_subject) && $ei_subject != null ? MyFunction::troncatedText($ei_subject, 10) : '');
?>
 
                    
                </a> 
            </li>
        </ul>  
    </div>




<!-- Box de recherche d'une livraison-->
<div id="deliverySearchBoxForSteps" class="modal  ">
    <div class="modal-dialog">
        <div class="modal-content">
コード例 #27
0
ファイル: EiScript.class.php プロジェクト: lendji4000/compose
 public static function getScriptUpdateResult(EiProjet $ei_project, EiProfil $kal_profil, EiTicket $ei_ticket, $json_string, KalFunction $kal_function, EiUser $ei_user, $script_id = 0, Doctrine_Connection $conn = null)
 {
     if ($conn == null) {
         $conn = Doctrine_Manager::connection();
     }
     $ei_subject = Doctrine_Core::getTable("EiSubject")->findOneByPackageIdAndPackageRef($ei_ticket->getTicketId(), $ei_ticket->getTicketRef());
     if ($ei_subject == null) {
         return array("success" => false, "message" => "Intervention not found ... ");
     }
     //Intervention non trouvée
     //Appel du webservice
     $result_update = MyFunction::loadResultOfWebServiceByPostJson(MyFunction::getPrefixPath(null) . "serviceweb/project/script/update.json", array('project_id' => $ei_project->getProjectId(), 'project_ref' => $ei_project->getRefId(), 'ticket_id' => $ei_ticket->getTicketId(), 'ticket_ref' => $ei_ticket->getTicketRef(), 'profile_id' => $kal_profil->getProfileId(), 'profile_ref' => $kal_profil->getProfileRef(), 'function_id' => $kal_function->getFunctionId(), 'function_ref' => $kal_function->getFunctionRef(), 'script_id' => $script_id, 'user_id' => $ei_user->getUserId(), 'user_ref' => $ei_user->getRefId(), 'package_name' => "Package_S" . $ei_subject->getId(), 'json_string' => rawurlencode($json_string)));
     //Récupération du projet pour traitement
     //        if ($result_update == null) return null;
     //        $result_file->loadXML($result_update);
     //        $result_file->save('result_update.xml'); /* sauvegarde du fichier pour vérifier le bon fonctionnement du web service */
     //        $result_item=$result_file->documentElement;
     //        if ($result_item->getElementsByTagName("error")->item(0)):
     //            return -1;
     //        endif;
     //        if ($result_item->getElementsByTagName("process_error")->item(0)):
     //            return 0;
     //        endif;
     //        if ($result_item->getElementsByTagName("process_ok")->item(0)):
     //            return 1;
     //        endif;
     try {
         $conn->beginTransaction();
         //Récupération du ticket pour traitement
         $array_result = json_decode(html_entity_decode($result_update), true);
         //Récupération du projet pour traitement
         if (count($array_result) == 0) {
             return array("success" => false, "message" => "Error on transaction");
         }
         if (array_key_exists("error", $array_result)) {
             return array("success" => false, "message" => $array_result["error"]);
         }
         if (array_key_exists("process_error", $array_result)) {
             return array("success" => false, "message" => $array_result["process_error"]);
         }
         if (!$array_result[0]) {
             return array("success" => false, "message" => "Empty result content");
         }
         self::reload($array_result, $conn);
         $conn->commit();
         return array("success" => true, "message" => "Transaction maded successfully");
     } catch (Exception $e) {
         throw new Exception($e);
         $conn->rollback();
         return array("success" => false, "message" => "Error on reload process ...");
     }
 }
コード例 #28
0
        echo $name;
        ?>
</h2></th>
        </tr> 
        <?php 
        foreach ($fonctions as $id_fonction => $noticeVersion) {
            ?>
 
            <?php 
            if (sfOutputEscaper::unescape($noticeVersion) != null) {
                ?>
                <tr> 
                    <td class="desc_img_notice">
                        <!-- Traitement des paramètres variables dans la notice -->
                        <?php 
                echo html_entity_decode(MyFunction::parseDescImg($noticeVersion['description'], $id_fonction, $profileParams));
                ?>
                    </td> 
                </tr> 
                <?php 
            } else {
                ?>
                <tr> 
                    <td class="desc_img_notice">
                        <h6>No Notice Version define for this environment and language</h6>
                    </td> 
                </tr> 
            <?php 
            }
            ?>
 
コード例 #29
0
<?php

if (isset($ei_project) && $ei_project != null && isset($ei_profile) && $ei_profile != null) {
    ?>
<!--On est dans le module scénario --> 
<?php 
    $url_tab = array('project_id' => $project_id, 'project_ref' => $project_ref, 'profile_id' => $profile_id, 'profile_ref' => $profile_ref, 'profile_name' => $profile_name);
    ?>
    <?php 
    if ($sf_request->getParameter('action') == 'index') {
        $title = 'Project Functions';
        $originalTitle = 'Project Functions';
    } else {
        $title = MyFunction::troncatedText($kal_function, 17);
        $originalTitle = $kal_function;
    }
    //  Menu objet
    include_partial('global/sideBarCurrentObject', array('title' => $title, 'icon' => 'ei_function', 'originalTitle' => $originalTitle, 'dataContent' => ''));
    //Livraisons ouvertes
    include_partial('global/openDeliveries', array('openDeliveries' => $openDeliveries, 'delivery_show_uri' => $url_tab));
}
?>
 
  
コード例 #30
0
        ?>
">
                       <?php 
        echo MyFunction::troncatedText($del, 50);
        ?>
                </a>
            </td>
            <td>
                <a href="#"
                   class="tooltipObjTitle"   data-placement="top" data-toggle="tooltip"
                   data-original-title="<?php 
        echo $del->getSfGuardUser()->getUsername();
        ?>
"> 
                       <?php 
        echo MyFunction::troncatedText($del->getSfGuardUser()->getUsername(), 25);
        ?>
                </a>
            </td>
            <td>
                <div class="row">
                    <div class="col-lg-11 col-md-11 col-sm-11 col-xs-11">
                       <div class="progress thin">
                            <?php 
        $perc = ($del->nbSub != 0 ? $del->nbSubOpen / $del->nbSub : 0) * 100;
        ?>
                            <?php 
        if ($perc < 25) {
            $progressClass = 'progress-bar-danger';
        }
        ?>