Example #1
0
 public function actionEdit()
 {
     $this->layout = '//layouts/admin';
     $success = false;
     $id = $_REQUEST['id'];
     $model = ListsFields::model()->findByPk($id);
     $list = Lists::model()->findByPk($model->list_id);
     $this->pageTitle = is_object($model) ? $model->name : 'Новая характеристика';
     $this->breadcrumbs = array('Справочники' => array('/admin/lists'), $list->name => array('/admin/lists/edit/' . $list->id), 'Управление характеристиками' => array('/admin/lists/fields/list/' . $list->id), $model->title);
     if (isset($_POST['data']) && is_object($model)) {
         $dataArray = $_POST['data'];
         if ($dataArray['data_type'] == 'list' || $dataArray['data_type'] == 'multiple') {
             if (!isset($dataArray['rel']) || !$dataArray['rel']) {
                 $newList = new Lists();
                 $newList->setAttributes(array("name" => "Справочник для <" . $dataArray['title'] . ">"));
                 if ($newList->save()) {
                     $dataArray['rel'] = $newList->id;
                 }
             }
         }
         $model->setAttributes($dataArray);
         if ($model->save()) {
             $success = true;
         }
     }
     $this->render('edit', array('model' => $model, 'list' => $list, 'success' => $success, 'errors' => $model->errors));
 }
 public function actionIndex()
 {
     //		$dataProvider = new CActiveDataProvider('Lists', array(
     //															  'pagination' => false/*array('pageSize' => 40)*/,
     //															  'sort' => array('multiSort' => true),
     //														 ));
     $model = new Lists('search');
     if (isset($_GET['Lists'])) {
         $model->attributes = $_GET['Lists'];
     }
     $dataProvider = $model->search();
     $dataProvider->pagination = false;
     $dataProvider->sort = array('multiSort' => true);
     $this->render('index', array('dataProvider' => $dataProvider));
 }
Example #3
0
 public function testListsGetAll()
 {
     Client::relateIQ(GlobalVar::KEY, GlobalVar::SECRET);
     Lists::setFetchOptions(["_ids" => "53ae0c09e4b0f0eb6bc57ecd"]);
     $lists = Lists::fetchPage();
     $this->assertNotNull($lists);
 }
 public function run($name)
 {
     if ($name) {
         $list = Lists::getListByName($name);
     }
     Rest::json(array("result" => true, "list" => $list));
 }
 public function overwriteForm($return, $returnfull)
 {
     $return = parent::overwriteForm($return, $returnfull);
     $p = new Lists();
     //        $p->default_read_coloms = "ID,post_title";
     $arrPage = $p->getAll();
     $arrNe = array();
     foreach ($arrPage as $pp) {
         $arrNe[$pp->list_id] = $pp->list_id . " - " . $pp->list_name;
     }
     $return['list_pic'] = new \Leap\View\InputFoto("list_pic", "list_pic", $this->list_pic);
     //        $return['carousel_active'] = new Leap\View\InputSelect($this->arrayYesNO, "carousel_active", "carousel_active",
     //            $this->carousel_active);
     $return['list_descr'] = new Leap\View\InputTextArea("list_descr", "list_descr", $this->list_descr);
     $return['list_parent_id'] = new Leap\View\InputSelect($arrNe, "list_parent_id", "list_parent_id", $this->list_parent_id);
     //comment di set di page
     $return['list_urutan'] = new Leap\View\InputText("number", "list_urutan", "list_urutan", $this->list_urutan);
     return $return;
 }
 public function testListitemDelete()
 {
     Client::relateIQ(GlobalVar::KEY, GlobalVar::SECRET);
     $data = ["id" => "53ae0c09e4b0f0eb6bc57ecd"];
     $listObj = new Lists($data);
     $this->assertNotNull($listObj->id());
     //Creating ListItems...
     $account = new Account([]);
     $contact = new Contact(["id" => "53b4b4cce4b0e6c80c5fca0c"]);
     $listItem = new ListItems(["parent" => $listObj]);
     $listItem->accountId($account->id());
     $listItem->contactIds($contact->id());
     $listItem->name("MASH Realtors");
     $listItem->fieldValues(["0" => "5", "2" => "0"]);
     $res = $listItem->create();
     $this->assertNotNull($res->id());
     $idList = $res->id();
     //Deleting ListItems...
     $listItem = $listObj->ListItem($idList);
     $res = $listItem->delete();
     $this->assertEquals(true, $res);
 }
Example #7
0
 public function __construct()
 {
     Lists::$database_connect = mysql_connect(self::DATABASE_HOST, self::DATABASE_USER, self::DATABASE_PASSWORD);
     if (!Lists::$database_connect) {
         echo "Unable to connect to DB: " . mysql_error(Lists::$database_connect);
         exit;
     }
     mysql_query("SET NAMES 'UTF8'", Lists::$database_connect);
     if (!mysql_select_db(self::DATABASE_NAME, Lists::$database_connect)) {
         echo "Unable to select mydbname: " . mysql_error(Lists::$database_connect);
         exit;
     }
 }
 public function run($id, $type)
 {
     $controller = $this->getController();
     $params = array();
     if ($type == Organization::COLLECTION) {
         $params["organizationId"] = $id;
     }
     $lists = Lists::get(array("eventTypes"));
     $params["lists"] = $lists;
     if (Yii::app()->request->isAjaxRequest) {
         echo $controller->renderPartial("eventSV", $params, true);
     }
 }
Example #9
0
 public function executeGetLinkedListItems()
 {
     $this->setLayout(false);
     if (is_numeric($id = $this->getRequestParameter('id'))) {
         $list = Lists::getChildListForItem($id);
     }
     if ($list) {
         $items = Lists::getListitemsByListId($list->getListId());
     }
     foreach ($items as $item) {
         $options .= "<option value='" . $item->getId() . "'>" . $item->getLabel() . "</option>";
     }
     return $this->renderText($options);
 }
Example #10
0
 public function getNotRelatedLists($exluded)
 {
     if (null == $this->notRelatedLists) {
         $query = Lists::query();
         if ($exluded->count()) {
             $lists = [];
             foreach ($exluded as $row) {
                 $lists[] = $row->id;
             }
             $query = $query->notInWhere('id', $lists);
         }
         //            dd($query);
         $this->notRelatedLists = $query->execute();
     }
     return $this->notRelatedLists;
 }
Example #11
0
 public function offsetGet($offset)
 {
     $helper = new ListsHelper();
     if ($offset) {
         $keys = Keywords::getKeyCodes();
         $exp = '[';
         foreach ($keys as $id => $code) {
             $exp .= '\\' . $code;
         }
         $exp .= ']';
         preg_match('/^(' . $exp . ')(.*?)$/', $offset, $matches);
         if (count($matches)) {
             $exists = array_search($matches[1], $keys);
             if ($exists !== false) {
                 if ($matches[2]) {
                     $helper->getTasksByKeyword($matches[2], $exists);
                     #FB::info($helper, 'Tasks for Keyword');
                 } else {
                     $helper->getKeynamesByKeyType($exists);
                 }
             }
         } else {
             if (Keywords::keyExists($offset, "'/'")) {
                 /**
                  *  Handling directory as a list
                  **/
                 $type = array_search('/', $keys);
                 #FB::log($type, 'TYPE');
                 Site::$section = '/' . $offset;
                 $helper->getTasksByKeyword($offset, $type);
                 #FB::info(self::$lists, 'Tasks for Keyword 2');
             } else {
                 #FB::error($offset, 'We don\'t know this');
             }
         }
     } else {
         /**
          *  @todo add javascript handling of location.hash 			
          **/
         #FB::error('@todo location.hash js');
         $helper->getLists();
     }
     if (!isset($helper->lists)) {
         $helper->getLists();
     }
     self::$lists = $helper->lists;
 }
Example #12
0
 /**
  * 
  */
 public function run($id)
 {
     $controller = $this->getController();
     $params = array();
     //get The organization Id
     if (empty($id)) {
         throw new CTKException(Yii::t("organisation", "The Parent organization doesn't exist !"));
     }
     $params["parentOrganization"] = Organization::getPublicData($id);
     $lists = Lists::get(array("organisationTypes", "typeIntervention", "public"));
     if (!isset($lists["organisationTypes"]) || !isset($lists["typeIntervention"]) || !isset($lists["public"])) {
         throw new CTKException(Yii::t("organisation", Yii::t("organisation", "Missing List data in 'lists' collection, must have organisationTypes, typeIntervention, public")));
     }
     $params["types"] = $lists["organisationTypes"];
     $params["listTypeIntervention"] = $lists["typeIntervention"];
     $params["listPublic"] = $lists["public"];
     $params["tags"] = Tags::getActiveTags();
     $controller->layout = "//layouts/mainSimple";
     $controller->render("join", $params);
 }
Example #13
0
 public function delete($con = null)
 {
     try {
         $con = Propel::getConnection();
         $con->begin();
         //deletes generic document
         $genericDocument = Document::getGenericDocument($this);
         $genericDocument->delete();
         parent::delete();
         $con->commit();
         Document::deleteObjCache($this);
         // update list cache
         if (get_class($parent) == "Lists") {
             Lists::updateListCache($parent->getListId());
         }
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
Example #14
0
 private function feed()
 {
     Phalanx::loadClasses('Profile', 'Lists', 'PostCategory');
     $user_data = Profile::get_profile($this->session->user->login);
     #Correção p/ um bug com os nomes de usuários incorretos
     if (empty($user_data->login)) {
         Request::redirect(HOST);
     } else {
         #Reutilização do mesmo core para criação da timeline - F**k yeah
         Phalanx::loadController('TimelineController');
         $Timeline = new TimelineController();
         $posts = $Timeline->BuildFromList($this->cookies->active_list);
         #Pego os outros dados do usuário que são utilizados na página de feed
         $this->views = new Views(new Template("default"));
         $this->views->data = $user_data;
         $this->views->lists = Lists::from_user($this->session->user->id);
         $this->views->categories = PostCategory::get();
         $this->views->posts = $posts;
         $this->views->display("feed.phtml");
     }
 }
Example #15
0
    <?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'repair-form', 'enableAjaxValidation' => false, 'htmlOptions' => array('enctype' => 'multipart/form-data', 'class' => 'form-horizontal form-border')));
?>


    <?php 
// echo $form->errorSummary($model);
?>

    <div class="form-group">
        <?php 
echo $form->labelEx($model, 'car_id', array('class' => 'col-lg-2 control-label'));
?>
        <div class="col-lg-2">
            <?php 
echo $form->dropDownList($model, 'car_id', Lists::car(), array('empty' => $this->labelController['messageSelect'], 'class' => 'form-control'));
?>
            <?php 
echo $form->error($model, 'car_id');
?>
        </div>
    </div>

    <div class="form-group">
        <?php 
echo $form->labelEx($model, 'amount', array('class' => 'col-lg-2 control-label'));
?>
        <div class="col-lg-1">
            <?php 
echo $form->textField($model, 'amount', array('maxlength' => 11, 'class' => 'form-control'));
?>
Example #16
0
function run_generate_cache($task, $args)
{
    ini_set("memory_limit", "2048M");
    ini_set("display_errors", 1);
    define('SF_ROOT_DIR', sfConfig::get('sf_root_dir'));
    define('SF_APP', 'frontend');
    define('SF_ENVIRONMENT', 'dev');
    define('SF_DEBUG', false);
    sfConfig::set("sf_use_relations_cache", false);
    require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php';
    $databaseManager = new sfDatabaseManager();
    $databaseManager->initialize();
    run_url_relations($task, $args);
    run_tags_relations($task, $args);
    echo_cms_title("GENERATING CACHE...");
    if (!class_exists("XMLParser")) {
        include sfConfig::get('sf_root_dir') . "/lib/tools/XMLParser.class.php";
    }
    if (!class_exists("FileHelper")) {
        include sfConfig::get('sf_root_dir') . "/lib/helper/FileHelper.php";
    }
    //echo_cms_sep();
    echo_cms("sf_cache_objects = " . sfConfig::get('sf_cache_objects'));
    echo_cms("sf_cache_relations = " . sfConfig::get('sf_cache_relations'));
    echo_cms("sf_cache_trees = " . sfConfig::get('sf_cache_trees'));
    //echo_cms_sep();
    if (count($args) > 0) {
        $relationsFlag = substr($args[0], 0, 3) == "rel";
        $listsFlag = substr($args[0], 0, 4) == "list";
        $cacheModel = $args[0];
        if (is_numeric($cacheModel)) {
            $obj = Document::getDocumentInstance($cacheModel);
            if ($obj) {
                $phpName = get_class($obj);
            } else {
                echo_cms_error("Object with ID=" . $cacheModel . " not found!");
                exit;
            }
        }
    }
    // parse schema file to make Schema.class.php
    $objects = XMLParser::getXMLdataValues(sfConfig::get('sf_root_dir') . "/config/schema.xml");
    $schemaFile = sfConfig::get('sf_root_dir') . "/config/Schema.class.php";
    $content = $content = "<?php\n class Schema\n{\n\n";
    echo_cms("Building " . $schemaFile . "... ");
    foreach ($objects as $obj) {
        if ($obj['tag'] == 'TABLE' && $obj['type'] == 'open') {
            $table = $obj['attributes']['PHPNAME'];
            if ($phpName && $phpName == $table) {
                $tableName = $obj['attributes']['NAME'];
            }
            $trees = explode(",", $obj['attributes']['TREE']);
            $content .= "\tpublic static function get" . $table . "Trees()\n\t{\n";
            $content .= "\t\treturn array(";
            foreach ($trees as $tree) {
                $content .= "'" . strtolower($tree) . "', ";
            }
            $content = substr($content, 0, -2);
            $content .= ");\n\t}\n\n";
            $content .= "\tpublic static function get" . $table . "Properties()\n\t{\n";
            $content .= "\t\treturn array(";
        }
        if ($obj['tag'] == 'COLUMN' && $obj['type'] == 'complete') {
            $property = $obj['attributes']['NAME'];
            $getProperty = UtilsHelper::convertFieldName($property);
            $content .= "'" . $getProperty . "', ";
        }
        if ($obj['tag'] == 'TABLE' && $obj['type'] == 'close') {
            $content = substr($content, 0, -2);
            $content .= ");\n\t}\n\n";
        }
    }
    $content .= "\n}";
    //echo_cms_sep();
    if (FileHelper::writeFile($schemaFile, $content)) {
        echo_cms($schemaFile . " writen successfully!");
    } else {
        echo_cms_error("Error writing " . $schemaFile . "!");
    }
    echo "\n";
    //echo_cms_sep();
    if (substr($args[0], 0, 5) == "schema") {
        echo_cms(" Done!");
        exit;
    }
    if (!$relationsFlag && !$listsFlag) {
        try {
            if (is_numeric($cacheModel)) {
                $obj = array();
                $obj['tag'] = 'OBJECT';
                $obj['type'] = 'complete';
                $obj['id'] = $cacheModel;
                $objects = array($obj);
                $exit = true;
            } elseif ($cacheModel) {
                $obj = array();
                $obj['tag'] = 'OBJECT';
                $obj['type'] = 'complete';
                $obj['value'] = $cacheModel;
                $objects = array($obj);
                $exit = true;
            } else {
                $objects = XMLParser::getXMLdataValues(sfConfig::get('sf_root_dir') . "/config/cachedObjects.xml");
            }
            foreach ($objects as $obj) {
                if ($obj['tag'] == 'OBJECT' && $obj['type'] == 'complete') {
                    if ($id = $obj['id']) {
                        $obj = Document::getDocumentInstance($id);
                        $model = get_class($obj);
                        $c = new Criteria();
                        $c->add($tableName . '.ID', $id);
                    } else {
                        $model = $obj['value'];
                        $c = new Criteria();
                    }
                    $classPeer = ucfirst($model) . "Peer";
                    //$c = new Criteria();
                    //$results = call_user_func(array($classPeer, 'doSelect'), $c);
                    $peerMethod = "doSelect";
                    $results = call_user_func(array($classPeer, $peerMethod), $c);
                    echo_cms("  Caching " . $model . " documents");
                    $ind = 0;
                    foreach ($results as $result) {
                        if ($ind % 20 == 0) {
                            echo $ind . "  .\r";
                        } else {
                            if ($ind % 10 == 0) {
                                echo $ind . "  o\r";
                            }
                        }
                        $ind++;
                        Document::cacheObj($result, $model, false);
                    }
                    echo_cms(" ====> " . $ind . " " . $model . " Document(s) cached.");
                    //echo_cms_sep();
                }
            }
            if ($exit) {
                exit;
            }
        } catch (Expection $e) {
            echo_cms_error(" Error: {$e}");
        }
    }
    if (!$listsFlag) {
        echo "\n";
        //echo_cms_sep();
        echo_cms("Writing relations cache");
        Relation::checkRelationCache('lock');
        try {
            $c = new Criteria();
            $c->addAscendingOrderByColumn('id1');
            $c->addAscendingOrderByColumn('document_model2');
            $c->addAscendingOrderByColumn('sort_order');
            $relations = RelationPeer::doSelect($c);
            $relationsFile = sfConfig::get('sf_root_dir') . "/cache/objcache/childrenRelations.php";
            echo_cms("Processing children :");
            $i = 0;
            $content = "<?php \n";
            $oldIDModel = '';
            $currIDModel = '';
            $idStr = '';
            foreach ($relations as $relation) {
                $currIDModel = $relation->getId1() . ':' . $relation->getDocumentModel2();
                if ($i == 0) {
                    $oldIDModel = $currIDModel;
                }
                $i++;
                echo $i . "\t\t\r";
                if ($currIDModel == $oldIDModel) {
                    $idStr .= "," . $relation->getId2();
                } else {
                    $idStr = substr($idStr, 1);
                    $content .= "\$_Rel[" . $oldId1 . "][\"" . $oldModel2 . "\"] = explode(\",\", \"" . $idStr . "\");\n";
                    $idStr = "," . $relation->getId2();
                }
                $oldIDModel = $currIDModel;
                $oldId1 = $relation->getId1();
                $oldModel2 = $relation->getDocumentModel2();
            }
            if ($idStr) {
                $idStr = substr($idStr, 1);
                $content .= "\$_Rel[" . $oldId1 . "][\"" . $oldModel2 . "\"] = explode(\",\", \"" . $idStr . "\");\n";
            }
            echo "\n";
            $content .= "\n?>";
            //echo_cms_sep();
            if (FileHelper::writeFile($relationsFile, $content)) {
                echo_cms($relationsFile . " written successfully");
            } else {
                echo_cms_error("Error writing " . $relationsFile . " !");
            }
            //echo_cms_sep();
        } catch (Exception $e) {
            echo "Error: " . $e->getMessage();
        }
        Relation::checkRelationCache('unlock');
    }
    if (!$relationsFlag) {
        echo "\n";
        //echo_cms_sep();
        echo_cms_title("Writing Lists cache");
        $listsRootFolder = Rootfolder::getRootfolderByModule("lists");
        if ($listsRootFolder) {
            $lists = Document::getChildrenOf($listsRootFolder->getId(), "Lists");
        }
        foreach ($lists as $list) {
            $listId = $list->getListId();
            echo "\t\tprocessing \"" . $listId . "\" list ...";
            $listPath = sfConfig::get('sf_root_dir') . "/cache/listscache/" . $listId . ".php";
            @unlink($listPath);
            $content = "<?php \n";
            $content .= "\$listItemsForSelect = array(\n";
            $items = Lists::getListitemsForSelect($listId, array(), false);
            foreach ($items as $key => $item) {
                $content .= "\"" . str_replace("\"", "\\\"", $key) . "\" => \"" . str_replace("\"", "\\\"", $item) . "\",\n";
            }
            $content .= ");\n?>";
            if (FileHelper::writeFile($listPath, $content)) {
                echo_cms(" Done!");
            } else {
                echo_cms_error(" Error!");
            }
        }
        //echo_cms_sep();
    }
    sfConfig::set("sf_use_relations_cache", true);
}
Example #17
0
    ?>
><?php 
    echo $name;
    ?>
</option>
                                    <?php 
}
?>
                                </select>
                            </div>
                            <div class="form-group rel" style="display: none;">
                                <label>Связь</label>
                                <select name="data[rel]" class="form-control">
                                    <option value="">Выберите справочник</option>
                                <?php 
$items = Lists::model()->findAll();
foreach ($items as $item) {
    ?>
                                    <option value="<?php 
    echo $item->id;
    ?>
"<?php 
    echo $model->rel == $item->id ? ' selected="selected"' : '';
    ?>
><?php 
    echo $item->name;
    ?>
</option>
                                    <?php 
}
?>
 /**
  * Dashboard Organization
  */
 public function run($id)
 {
     $controller = $this->getController();
     if (empty($id)) {
         throw new CTKException(Yii::t("organisation", "The organization id is mandatory to retrieve the organization !"));
     }
     $organization = Organization::getPublicData($id);
     $events = Organization::listEventsPublicAgenda($id);
     $controller->title = isset($organization["name"]) ? $organization["name"] : "";
     $controller->subTitle = isset($organization["shortDescripion"]) ? $organization["shortDescripion"] : "";
     $controller->pageTitle = $controller->title . " - " . $controller->subTitle;
     $params = array("organization" => $organization);
     $params["events"] = $events;
     //Same content Key base as the dashboard
     $contentKeyBase = Yii::app()->controller->id . ".dashboard";
     $params["contentKeyBase"] = $contentKeyBase;
     $limit = array(Document::IMG_PROFIL => 1, Document::IMG_MEDIA => 5);
     $images = Document::getListDocumentsURLByContentKey($id, $contentKeyBase, Document::DOC_TYPE_IMAGE, $limit);
     $params["images"] = $images;
     $documents = Document::getWhere(array("type" => Organization::COLLECTION, "id" => $id));
     $params["documents"] = $documents;
     $contextMap = array();
     $contextMap["organization"] = $organization;
     $contextMap["events"] = array();
     $contextMap["organizations"] = array();
     $contextMap["people"] = array();
     $organizations = Organization::getMembersByOrganizationId($id, Organization::COLLECTION);
     $people = Organization::getMembersByOrganizationId($id, Person::COLLECTION);
     foreach ($organizations as $key => $value) {
         $newOrga = Organization::getById($key);
         array_push($contextMap["organizations"], $newOrga);
     }
     if (isset($organization["links"]) && isset($organization["links"]["members"])) {
         $equipe = array();
         $ca = array();
         $bureau = array();
         foreach ($organization["links"]["members"] as $key => $value) {
             if ($value["type"] == PHType::TYPE_CITOYEN && isset($value["roles"])) {
                 $person = Person::getById($key);
                 if (!empty($person)) {
                     if (in_array("Bureau", $value["roles"])) {
                         $bureau[$key] = $person;
                     }
                     if (in_array("Conseil d'administration", $value["roles"])) {
                         $ca[$key] = $person;
                     }
                     if (in_array("Equipe", $value["roles"])) {
                         $equipe[$key] = $person;
                     }
                 }
             }
         }
         if (count($equipe) > 0) {
             $params["equipe"] = $equipe;
         }
         if (count($ca) > 0) {
             $params["ca"] = $ca;
         }
         if (count($bureau) > 0) {
             $params["bureau"] = $bureau;
         }
     }
     foreach ($events as $key => $value) {
         $newEvent = Event::getById($key);
         array_push($contextMap["events"], $newEvent);
     }
     foreach ($people as $key => $value) {
         $newCitoyen = Person::getById($key);
         array_push($contextMap["people"], $newCitoyen);
     }
     $params["contextMap"] = $contextMap;
     $params["countries"] = OpenData::getCountriesList();
     $lists = Lists::get(array("organisationTypes"));
     $params["organizationTypes"] = $lists["organisationTypes"];
     $controller->title = isset($organization["name"]) ? $organization["name"] : "";
     $controller->render("dashboard1", $params);
 }
Example #19
0
 public function actionEdit()
 {
     $bookmark = Bookmarks::model()->findByPk(Yii::app()->request->getParam('bkid'));
     if ($bookmark === null) {
         $this->redirect(['index/index']);
     }
     if (Yii::app()->request->isPostRequest) {
         $bookmark->title = Yii::app()->request->getPost('bk_title');
         $bookmark->url = Yii::app()->request->getPost('bk_url');
         $bookmark->note = Yii::app()->request->getPost('bk_note');
         $list = Lists::model()->findByPk(Yii::app()->request->getPost('bk_list'));
         if ($list !== null && $list->user_id == Yii::app()->user->id) {
             $bookmark->list_id = $list->id;
         } else {
             $bookmark->list_id = null;
         }
         $bookmark->save();
         $this->redirect(['index/index']);
     }
     $lists = Yii::app()->user->model->lists;
     $this->render('edit', ['bookmark' => $bookmark, 'lists' => $lists]);
 }
Example #20
0
if ($mobile) {
    echo CHtml::dropDownList('Place[sortField]', $sortFieldVal, $sorFieldList);
} else {
    echo CHtml::radioButtonList('Place[sortField]', $sortFieldVal, $sorFieldList, array('class' => 'no-margin', 'separator' => '&nbsp;&nbsp;&nbsp;&nbsp;', 'labelOptions' => array('class' => 'radio-label right-margin')));
}
?>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="cell">
					<label class="block-label">Show</label>

					<div class="input-wrapper">
						<?php 
$radioButtonList = Lists::model()->getList("PublicPlacesParkType");
foreach ($radioButtonList as $thisKey => $radioButton) {
    if ($radioButton == 'None') {
        $radioButtonList[$thisKey] = 'All';
    }
}
$typeId = isset($place['typeId']) ? $place['typeId'] : 1;
?>
						<?php 
if ($mobile) {
    echo CHtml::dropDownList('Place[typeId]', $typeId, $radioButtonList);
} else {
    echo CHtml::radioButtonList('Place[typeId]', $typeId, $radioButtonList, array('class' => 'no-margin', 'separator' => '&nbsp;&nbsp;&nbsp;&nbsp;', 'labelOptions' => array('class' => 'radio-label right-margin')));
}
?>
					</div>
Example #21
0
                         echo "get borrower log of book";
                     } else {
                         if ($index_a[1] == "modify") {
                             echo "modify book";
                         }
                     }
                 }
             }
         }
     }
 } else {
     if ($index_a[0] == "users") {
         //User pages
         if (!isset($index_a[1])) {
             require 'list.class.php';
             $list = new Lists($index_a[0]);
             $res['users'] = $list->getList();
         } else {
             if ($index_a[1] == "stats") {
                 require 'stats.class.php';
                 //Default stats page, without extra variables
                 //$index_a[2] == book id
                 if (count($index_a) == 3) {
                     $stats = new Stats($index_a[0], $index_a[2]);
                     $res['stats'] = $stats->printStats();
                 } else {
                     //As there are no "global" stats for users yet (haven't come up with a reason to have it, and what it would include)
                     $res['error'] = 'Ingen bruker er spesifisert.';
                 }
             }
         }
Example #22
0
echo $form->textArea($model, 'description', ['style' => 'height:395px;width:750px;']);
?>
			</div>
			<?php 
echo $form->endControlGroup();
?>

			<?php 
echo $form->beginControlGroup($model, 'status');
?>
			<?php 
echo $form->controlLabel($model, 'status');
?>
			<div class="controls">
				<?php 
echo $form->radioButtonList($model, 'status', Lists::model()->getList("propertyCategoryStatus"), ['separator' => '']);
?>
			</div>
			<?php 
echo $form->endControlGroup();
?>

			<?php 
echo $form->beginControlGroup($model, 'displayOnHome');
?>
			<?php 
echo $form->controlLabel($model, 'displayOnHome');
?>
			<div class="controls">
				<?php 
echo $form->checkBox($model, 'displayOnHome');
Example #23
0
 private static function getOptions($options)
 {
     return implode('', Lists::map($options, function ($val, $key) use($inputInfo) {
         return '<option value="' . $val . '"' . ($inputInfo['value'] === $val ? ' selected="selected" ' : '') . '>' . (is_string($key) ? $key : $val) . '</option>';
     }));
 }
Example #24
0
						<?php 
echo $form->labelEx($model, 'dateTo');
?>
						<?php 
echo $form->textField($model, 'dateTo', array('placeholder' => 'dd/mm/yyyy', 'value' => $model->dateTo ? date("d/m/Y", strtotime($model->dateTo)) : ""));
?>
						<?php 
echo $form->textField($model, 'timeTo', array('placeholder' => 'hh:mm'));
?>
					</div>
					<div class="row">
						<?php 
echo $form->labelEx($model, 'status');
?>
						<?php 
echo $form->dropDownList($model, 'status', Lists::model()->getList("LocalEventStatus"));
?>
					</div>


					<h3>Events Address</h3>
					<?php 
$this->renderPartial("application.modules.admin4.views.location._location_form", array('model' => $address, 'form' => $form, 'parentModel' => $model, 'parentField' => 'addressID'));
?>
					<div class="row buttons">
						<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
					</div>
				</td>
				<td style="width:50%; vertical-align: top;">
Example #25
0
	<?php 
if ($obj) {
    echo 'ID: ' . $obj->getId();
}
?>
	<?php 
echo backend_input('attrLabel', $obj, array('labelname' => 'Label', 'model' => 'ListitemI18n', 'maxlength' => '255', 'required' => 'true', 'onfocus' => ' validateEditForm();'), 'getLabel');
?>

	<?php 
if ($userType == "admin") {
    ?>
		<?php 
    echo backend_input('attrValue', $obj, array('labelname' => 'Value', 'model' => 'ListitemI18n', 'maxlength' => '255'), 'getValue');
    ?>
	<?php 
}
?>

	<?php 
echo backend_select('attrCulture', $obj, Lists::getListitemsForSelect('culture'), array('labelname' => 'Culture', 'model' => 'ListitemI18n', 'unique' => 'true', 'required' => 'true', 'onchange' => ' validateEditForm();'), 'getCulture');
?>

	<?php 
echo backend_tags($tags, $obj);
?>
	<div id='line'></div>
	<input id='btnSubmit' type='submit' class='save_btndisabled' value='' disabled/>
</form>
</div>
<script type="text/javascript">setTimeout(function(){$('#backendMsg').fadeOut(1000)},2000);</script>
Example #26
0
 public static function getListbyListID($idList)
 {
     $model = Lists::model()->findByPk($idList);
     return $model;
 }
Example #27
0
		<?php 
echo backend_tags($tags, $obj);
?>
	</div>

	<div id='tab2' name='tabAdmin' style='display: none'>
		<?php 
echo backend_hidden('attrBackend', $obj, array('labelname' => 'Backend', 'model' => 'User'), 'getBackend');
?>
		<?php 
echo backend_select('attrType', $obj, Lists::getListitemsForSelect('usertype'), array('labelname' => 'Type', 'model' => 'User'), 'getType');
?>
	</div>

	<div id='tab3' name='tabUser' style='display: none'>
		<?php 
echo backend_date('attrBirthDate', $obj, array('labelname' => 'BirthDate', 'model' => 'User'), 'getBirthDate');
?>
		<?php 
echo backend_select('attrEducation', $obj, Lists::getListitemsForSelect('educations'), array('labelname' => 'Education', 'model' => 'User'), 'getEducation');
?>
		<?php 
echo backend_media('attrCv', $obj, array('labelname' => 'Cv', 'model' => 'User'), 'getCv');
?>
		</div>

	<div id='line'></div>
	<input id='btnSubmit' type='submit' class='save_btndisabled' value='' disabled/>
</form>
</div>
<script type="text/javascript">setTimeout(function(){$('#backendMsg').fadeOut(1000)},2000);</script>
 public function edit_list()
 {
     $list_id = Request::segment(3);
     $list = Lists::find($list_id)->toArray();
     $response_array = array();
     $response_array['list'] = $list;
     $response_array['list']['owner'] = User::find($list['owner_id'])->toArray();
     $response_array['list']['products'] = array();
     $products = DB::table('list_products')->leftJoin('products', 'list_products.product_id', '=', 'products.id')->where('list_products.list_id', $list_id)->select('products.*', 'list_products.quantity')->orderBy('list_products.sort_order')->get();
     if ($products) {
         foreach ($products as $product) {
             $product = json_decode(json_encode($product), true);
             array_push($response_array['list']['products'], $product);
         }
     }
     return View::make('edit_list')->with('data', $response_array)->with('store', $this->store)->with('departments', $this->departments)->with('zipcode', $this->zipcode)->with('city', $this->city)->with('stores', $this->stores);
 }
Example #29
0
<?php

// surat add
require_once "component/Surat.php";
require_once "component/List.php";
// get parameter
$kSurat = $getVars_kSurat ? $getVars_kSurat : $postVars_kSurat;
$noSurat = $postVars_noSurat;
$next = $postVars_next;
$content = $_REQUEST;
// validasi surat
if (!$kSurat || !$M_SURAT[$kSurat]) {
    header("Location:index.php?form=C.01");
}
$list = new Lists($ADODB);
$M_KAWIN = $list->getMKawin();
$M_AGAMA = $list->getMAgama();
$M_WARGA = $list->getMWarga();
$M_KERJA = $list->getMKerja();
$M_DUSUN = $list->getMDusun();
$M_PENDIDIDKAN = $list->getMPendidikan();
$confSurat = $M_SURAT[$kSurat];
// if next
if ($next) {
    // validasi data
    if (!$noSurat) {
        $errorCode = "Silahkan mengisi no surat!";
    }
    if (!$errorCode) {
        $surat = new Surat(&$ADODB);
        // input
Example #30
0
	<?php 
    if ($obj) {
        echo 'ID: ' . $obj->getId();
    }
    ?>
	<?php 
    echo backend_input('attrLabel', $obj, array('labelname' => 'Label', 'model' => 'Lists', 'maxlength' => '255', 'required' => 'true', 'onfocus' => ' validateEditForm();'), 'getLabel');
    ?>
	<?php 
    if ($userType == "admin") {
        ?>
		<?php 
        echo backend_input('attrListId', $obj, array('labelname' => 'List ID', 'model' => 'Lists', 'maxlength' => '255', 'required' => 'true', 'onfocus' => ' validateEditForm();'), 'getListId');
        ?>
		<?php 
        echo backend_select('attrListType', $obj, Lists::getListitemsForSelect('list_types'), array('labelname' => 'List type', 'model' => 'Lists', 'required' => 'true', 'onchange' => ' validateEditForm();'), 'getListType');
        ?>
	<?php 
    }
    ?>
	<?php 
    echo backend_tags($tags, $obj);
    ?>
	<div id='line'></div>
	<input id='btnSubmit' type='submit' class='save_btndisabled' value='' disabled/>
</form>
<?php 
}
?>
</div>
<script type="text/javascript">setTimeout(function(){$('#backendMsg').fadeOut(1000)},2000);</script>