當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Contacts::getAllNames方法代碼示例

本文整理匯總了PHP中Contacts::getAllNames方法的典型用法代碼示例。如果您正苦於以下問題:PHP Contacts::getAllNames方法的具體用法?PHP Contacts::getAllNames怎麽用?PHP Contacts::getAllNames使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Contacts的用法示例。


在下文中一共展示了Contacts::getAllNames方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ucfirst

        $versions = FormVersions::model()->findAllByAttributes(array('modelName' => ucfirst($_GET['model'])));
        foreach ($versions as $version) {
            $str2 .= "<a href='?model=" . $_GET['model'] . "&version=" . CHtml::encode($version->name) . "'>" . $version->name . "</a> | ";
        }
    }
    $str2 = substr($str2, 0, -3);
    $str2 .= "</h4><br />";
    echo $str2;
}
if ($formUrl == "") {
} elseif ($model instanceof Contacts) {
    $this->renderPartial($formUrl, array('contactModel' => $model, 'users' => User::getNames(), 'editor' => true));
} elseif ($model instanceof Actions) {
    $this->renderPartial($formUrl, array('actionModel' => $model, 'users' => User::getNames(), 'editor' => true));
} else {
    $this->renderPartial($formUrl, array('model' => $model, 'users' => User::getNames(), 'contacts' => Contacts::getAllNames(), 'editor' => true));
}
$fields = Fields::model()->findAllByAttributes(array('modelName' => get_class($model)), array('order' => 'tabOrder'));
if (isset($_GET['version'])) {
    $version = $_GET['version'];
    $version = FormVersions::model()->findByAttributes(array('name' => $version));
    $sizes = json_decode($version->sizes, true);
    $positions = json_decode($version->positions, true);
    $visibilities = json_decode($version->visibility, true);
    $tempArr = array();
    foreach ($fields as $field) {
        if (isset($positions[$field->fieldName])) {
            $field->coordinates = $positions[$field->fieldName];
            $field->size = $sizes[$field->fieldName];
            $field->visible = $visibilities[$field->fieldName];
            $tempArr[] = $field;
開發者ID:netconstructor,項目名稱:X2Engine,代碼行數:31,代碼來源:formEditor.php

示例2: actionAddContact

 public function actionAddContact($id)
 {
     $users = User::getNames();
     unset($users['admin']);
     unset($users['']);
     foreach (Groups::model()->findAll() as $group) {
         $users[$group->id] = $group->name;
     }
     $contacts = Contacts::getAllNames();
     unset($contacts['0']);
     $model = $this->loadModel($id);
     $contacts = Sales::editContactArray($contacts, $model);
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Sales'])) {
         $temp = $model->associatedContacts;
         $tempArr = $model->attributes;
         $model->attributes = $_POST['Sales'];
         $arr = $_POST['Sales']['associatedContacts'];
         foreach ($arr as $contactId) {
             $rel = new Relationships();
             $rel->firstType = 'Contacts';
             $rel->firstId = $contactId;
             $rel->secondType = 'Sales';
             $rel->secondId = $model->id;
             $rel->save();
         }
         $model->associatedContacts = Sales::parseContacts($arr);
         $temp .= " " . $model->associatedContacts;
         $model->associatedContacts = $temp;
         $changes = $this->calculateChanges($tempArr, $model->attributes);
         $model = $this->updateChangelog($model, $changes);
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('addContact', array('model' => $model, 'users' => $users, 'contacts' => $contacts, 'action' => 'Add'));
 }
開發者ID:netconstructor,項目名稱:X2Engine,代碼行數:38,代碼來源:DefaultController.php

示例3: actionUpdate

 /**
  * Updates a particular model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id the ID of the model to be updated
  */
 public function actionUpdate($id)
 {
     $model = $this->loadModel($id);
     $users = User::getNames();
     $contacts = Contacts::getAllNames();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Cases'])) {
         $model->attributes = $_POST['Cases'];
         $model = $this->updateChangelog($model);
         $arr = $model->associatedContacts;
         $str = '';
         foreach ($arr as $contact) {
             $str .= ' ' . $contact;
         }
         $str = substr($str, 1);
         $model->associatedContacts = $str;
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('update', array('model' => $model, 'users' => $users, 'contacts' => $contacts));
 }
開發者ID:netconstructor,項目名稱:X2Engine,代碼行數:28,代碼來源:CasesController.php

示例4: actionAddUser

 public function actionAddUser($id)
 {
     $users = User::getNames();
     $contacts = Contacts::getAllNames();
     $model = $this->loadModel($id);
     $users = Accounts::editUserArray($users, $model);
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Projects'])) {
         $temp = $model->assignedTo;
         $model->attributes = $_POST['Projects'];
         $arr = $model->assignedTo;
         $this->updateChangelog($model);
         $model->assignedTo = ProjectChild::parseUsers($arr);
         $temp .= ', ' . $model->assignedTo;
         $model->assignedTo = $temp;
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('addUser', array('model' => $model, 'users' => $users, 'contacts' => $contacts));
 }
開發者ID:netconstructor,項目名稱:X2Engine,代碼行數:22,代碼來源:ProjectsController.php

示例5: actionAddUser

 public function actionAddUser($id)
 {
     $users = User::getNames();
     unset($users['admin']);
     unset($users['']);
     foreach (Groups::model()->findAll() as $group) {
         $users[$group->id] = $group->name;
     }
     $contacts = Contacts::getAllNames();
     $model = $this->loadModel($id);
     $users = Accounts::editUserArray($users, $model);
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Accounts'])) {
         $temp = $model->assignedTo;
         $tempArr = $model->attributes;
         $model->attributes = $_POST['Accounts'];
         $arr = $_POST['Accounts']['assignedTo'];
         $model->assignedTo = Accounts::parseUsers($arr);
         if ($temp != "") {
             $temp .= ", " . $model->assignedTo;
         } else {
             $temp = $model->assignedTo;
         }
         $model->assignedTo = $temp;
         $changes = $this->calculateChanges($tempArr, $model->attributes);
         $model = $this->updateChangelog($model, $changes);
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('addUser', array('model' => $model, 'users' => $users, 'contacts' => $contacts, 'action' => 'Add'));
 }
開發者ID:netconstructor,項目名稱:X2Engine,代碼行數:33,代碼來源:DefaultController.php


注:本文中的Contacts::getAllNames方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。