当前位置: 首页>>代码示例>>PHP>>正文


PHP Status::removeProjectAssociations方法代码示例

本文整理汇总了PHP中Status::removeProjectAssociations方法的典型用法代码示例。如果您正苦于以下问题:PHP Status::removeProjectAssociations方法的具体用法?PHP Status::removeProjectAssociations怎么用?PHP Status::removeProjectAssociations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Status的用法示例。


在下文中一共展示了Status::removeProjectAssociations方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update

 /**
  * Method used to update the details of the project information.
  *
  * @return  integer 1 if the update worked, -1 otherwise
  */
 public static function update()
 {
     if (Validation::isWhitespace($_POST['title'])) {
         return -2;
     }
     $stmt = 'UPDATE
                 {{%project}}
              SET
                 prj_title=?,
                 prj_status=?,
                 prj_lead_usr_id=?,
                 prj_initial_sta_id=?,
                 prj_outgoing_sender_name=?,
                 prj_outgoing_sender_email=?,
                 prj_mail_aliases=?,
                 prj_remote_invocation=?,
                 prj_segregate_reporter=?,
                 prj_customer_backend=?,
                 prj_workflow_backend=?
              WHERE
                 prj_id=?';
     try {
         DB_Helper::getInstance()->query($stmt, array($_POST['title'], $_POST['status'], $_POST['lead_usr_id'], $_POST['initial_status'], $_POST['outgoing_sender_name'], $_POST['outgoing_sender_email'], $_POST['mail_aliases'], $_POST['remote_invocation'], $_POST['segregate_reporter'], $_POST['customer_backend'], $_POST['workflow_backend'], $_POST['id']));
     } catch (DbException $e) {
         return -1;
     }
     self::removeUserByProjects(array($_POST['id']), $_POST['users']);
     foreach ($_POST['users'] as $user) {
         if ($user == $_POST['lead_usr_id']) {
             self::associateUser($_POST['id'], $user, User::getRoleID('Manager'));
         } elseif (User::getRoleByUser($user, $_POST['id']) == '') {
             // users who are now being associated with this project should be set to 'Standard User'
             self::associateUser($_POST['id'], $user, User::getRoleID('Standard User'));
         }
     }
     $statuses = array_keys(Status::getAssocStatusList($_POST['id']));
     if (count($statuses) > 0) {
         Status::removeProjectAssociations($statuses, $_POST['id']);
     }
     foreach ($_POST['statuses'] as $sta_id) {
         Status::addProjectAssociation($sta_id, $_POST['id']);
     }
     return 1;
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:49,代码来源:class.project.php

示例2: update

 /**
  * Method used to update the details of the project information.
  *
  * @access  public
  * @return  integer 1 if the update worked, -1 otherwise
  */
 function update()
 {
     global $HTTP_POST_VARS;
     if (Validation::isWhitespace($HTTP_POST_VARS["title"])) {
         return -2;
     }
     $stmt = "UPDATE\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project\n                 SET\n                    prj_title='" . Misc::escapeString($HTTP_POST_VARS["title"]) . "',\n                    prj_status='" . Misc::escapeString($HTTP_POST_VARS["status"]) . "',\n                    prj_lead_usr_id=" . Misc::escapeInteger($HTTP_POST_VARS["lead_usr_id"]) . ",\n                    prj_initial_sta_id=" . Misc::escapeInteger($HTTP_POST_VARS["initial_status"]) . ",\n                    prj_outgoing_sender_name='" . Misc::escapeString($HTTP_POST_VARS["outgoing_sender_name"]) . "',\n                    prj_outgoing_sender_email='" . Misc::escapeString($HTTP_POST_VARS["outgoing_sender_email"]) . "',\n                    prj_remote_invocation='" . Misc::escapeString($HTTP_POST_VARS["remote_invocation"]) . "',\n                    prj_segregate_reporter='" . Misc::escapeString($HTTP_POST_VARS["segregate_reporter"]) . "',\n                    prj_customer_backend='" . Misc::escapeString($HTTP_POST_VARS["customer_backend"]) . "',\n                    prj_workflow_backend='" . Misc::escapeString($HTTP_POST_VARS["workflow_backend"]) . "'\n                 WHERE\n                    prj_id=" . Misc::escapeInteger($HTTP_POST_VARS["id"]);
     $res = $GLOBALS["db_api"]->dbh->query($stmt);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return -1;
     } else {
         // START ETEL MODIFIED
         /* This is terrible right here:
                     Project::removeUserByProjects(array($HTTP_POST_VARS["id"]), $HTTP_POST_VARS["users"]);
                     for ($i = 0; $i < count($HTTP_POST_VARS["users"]); $i++) {
                         if ($HTTP_POST_VARS["users"][$i] == $HTTP_POST_VARS["lead_usr_id"]) {
                             Project::associateUser($HTTP_POST_VARS["id"], $HTTP_POST_VARS["users"][$i], User::getRoleID("Manager"));
                         } elseif (User::getRoleByUser($HTTP_POST_VARS["users"][$i], $HTTP_POST_VARS["id"]) == '') {
                             // users who are now being associated with this project should be set to 'Standard User'
                             Project::associateUser($HTTP_POST_VARS["id"], $HTTP_POST_VARS["users"][$i], User::getRoleID("Standard User"));
                         }
                     }
         			*/
         // END ETEL MODIFIED
         $statuses = array_keys(Status::getAssocStatusList($HTTP_POST_VARS["id"]));
         if (count($statuses) > 0) {
             Status::removeProjectAssociations($statuses, $HTTP_POST_VARS["id"]);
         }
         foreach ($HTTP_POST_VARS['statuses'] as $sta_id) {
             Status::addProjectAssociation($sta_id, $HTTP_POST_VARS["id"]);
         }
         return 1;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:41,代码来源:class.project.php

示例3: remove

 /**
  * Method used to remove a set of custom statuses.
  *
  * @access  public
  * @return  boolean
  */
 function remove()
 {
     global $HTTP_POST_VARS;
     $items = @implode(", ", Misc::escapeInteger($HTTP_POST_VARS["items"]));
     $stmt = "DELETE FROM\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "status\n                 WHERE\n                    sta_id IN ({$items})";
     $res = $GLOBALS["db_api"]->dbh->query($stmt);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return false;
     } else {
         Status::removeProjectAssociations($HTTP_POST_VARS['items']);
         // also set all issues currently set to these statuses to status '0'
         $stmt = "UPDATE\n                        " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue\n                     SET\n                        iss_sta_id=0\n                     WHERE\n                        iss_sta_id IN ({$items})";
         $GLOBALS["db_api"]->dbh->query($stmt);
         return true;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:23,代码来源:class.status.php


注:本文中的Status::removeProjectAssociations方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。