Exemple #1
0
        protected virtual XVar getShorteningTextAndMoreLink(dynamic _param_value, dynamic _param_cNumberOfChars, dynamic _param_keylink, dynamic _param_mode)
        {
            #region pass-by-value parameters
            dynamic value          = XVar.Clone(_param_value);
            dynamic cNumberOfChars = XVar.Clone(_param_cNumberOfChars);
            dynamic keylink        = XVar.Clone(_param_keylink);
            dynamic mode           = XVar.Clone(_param_mode);
            #endregion

            dynamic dataField = null, tName = null, truncatedValue = null, var_params = XVar.Array();
            truncatedValue = XVar.Clone(CommonFunctions.GetShorteningForLargeText((XVar)(value), (XVar)(cNumberOfChars)));
            if (XVar.Pack(this.searchHighlight))
            {
                truncatedValue = XVar.Clone(highlightTruncatedBeforeMore((XVar)(value), (XVar)(truncatedValue), (XVar)(cNumberOfChars), (XVar)(cNumberOfChars)));
            }
            tName      = XVar.Clone(getContainer().tName);
            var_params = XVar.Clone(XVar.Array());
            var_params.InitAndSetArrayItem(MVCFunctions.Concat("pagetype=", this.container.pSet._viewPage), null);
            var_params.InitAndSetArrayItem(MVCFunctions.Concat("table=", CommonFunctions.GetTableURL((XVar)(tName))), null);
            var_params.InitAndSetArrayItem(MVCFunctions.Concat("field=", MVCFunctions.RawUrlEncode((XVar)(this.field))), null);
            var_params.InitAndSetArrayItem(keylink, null);
            var_params.InitAndSetArrayItem(MVCFunctions.Concat("page=", this.container.pSet.pageName()), null);
            if (mode == Constants.LIST_DASHBOARD)
            {
                var_params.InitAndSetArrayItem(MVCFunctions.Concat("mode=", mode), null);
            }
            if (mode == Constants.LIST_LOOKUP)
            {
                var_params.InitAndSetArrayItem(MVCFunctions.Concat("maintable=", this.pageObject.mainTable), null);
                var_params.InitAndSetArrayItem(MVCFunctions.Concat("mainfield=", this.pageObject.mainField), null);
            }
            dataField = XVar.Clone(MVCFunctions.Concat("data-field=\"", MVCFunctions.runner_htmlspecialchars((XVar)(this.field)), "\""));
            return(MVCFunctions.Concat(truncatedValue, " <a href=\"javascript:void(0);\" data-gridlink data-query=\"", MVCFunctions.GetTableLink(new XVar("fulltext"), new XVar(""), (XVar)(MVCFunctions.implode(new XVar("&"), (XVar)(var_params)))), "\" ", dataField, ">", "Más", "&nbsp;...</a>"));
        }
Exemple #2
0
        public virtual XVar UnlockAdmin(dynamic _param_strtable, dynamic _param_keys, dynamic _param_startEdit)
        {
            #region pass-by-value parameters
            dynamic strtable  = XVar.Clone(_param_strtable);
            dynamic keys      = XVar.Clone(_param_keys);
            dynamic startEdit = XVar.Clone(_param_startEdit);
            #endregion

            dynamic sdate = null, skeys = null, where = null;
            skeys = new XVar("");
            foreach (KeyValuePair <XVar, dynamic> val in keys.GetEnumerator())
            {
                if (XVar.Pack(MVCFunctions.strlen((XVar)(skeys))))
                {
                    skeys = MVCFunctions.Concat(skeys, "&");
                }
                skeys = MVCFunctions.Concat(skeys, MVCFunctions.RawUrlEncode((XVar)(val.Value)));
            }
            sdate = XVar.Clone(MVCFunctions.now());
            if (XVar.Pack(startEdit))
            {
                insert((XVar)(strtable), (XVar)(sdate), (XVar)(sdate), (XVar)(skeys), (XVar)(MVCFunctions.session_id()), (XVar)(this.UserID), new XVar(1));
            }
            where = XVar.Clone(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("table")), "=", this.connection.prepareString((XVar)(strtable)), " AND ", this.connection.addFieldWrappers(new XVar("keys")), "=", this.connection.prepareString((XVar)(skeys)), " AND ", this.connection.addFieldWrappers(new XVar("action")), "=1 AND ", this.connection.addFieldWrappers(new XVar("sessionid")), "<>", this.connection.prepareString((XVar)(MVCFunctions.session_id()))));
            delete((XVar)(where));
            where = XVar.Clone(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("startdatetime")), "<", this.connection.addDateQuotes((XVar)(CommonFunctions.format_datetime_custom((XVar)(CommonFunctions.adddays((XVar)(CommonFunctions.db2time((XVar)(MVCFunctions.now()))), new XVar(-2))), new XVar("yyyy-MM-dd HH:mm:ss")))), " AND ", this.connection.addFieldWrappers(new XVar("action")), "=2"));
            delete((XVar)(where));
            insert((XVar)(strtable), (XVar)(sdate), (XVar)(sdate), (XVar)(skeys), (XVar)(MVCFunctions.session_id()), (XVar)(this.UserID), new XVar(2));
            return(null);
        }
Exemple #3
0
        public virtual XVar UnlockRecord(dynamic _param_strtable, dynamic _param_keys, dynamic _param_sid)
        {
            #region pass-by-value parameters
            dynamic strtable = XVar.Clone(_param_strtable);
            dynamic keys     = XVar.Clone(_param_keys);
            dynamic sid      = XVar.Clone(_param_sid);
            #endregion

            dynamic skeys = null, where = null;
            if (sid == XVar.Pack(""))
            {
                sid = XVar.Clone(MVCFunctions.session_id());
            }
            skeys = new XVar("");
            foreach (KeyValuePair <XVar, dynamic> val in keys.GetEnumerator())
            {
                if (XVar.Pack(MVCFunctions.strlen((XVar)(skeys))))
                {
                    skeys = MVCFunctions.Concat(skeys, "&");
                }
                skeys = MVCFunctions.Concat(skeys, MVCFunctions.RawUrlEncode((XVar)(val.Value)));
            }
            where = XVar.Clone(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("sessionid")), "=", this.connection.prepareString((XVar)(sid)), " AND ", this.connection.addFieldWrappers(new XVar("action")), "=1 AND ", this.connection.addFieldWrappers(new XVar("table")), "=", this.connection.prepareString((XVar)(strtable)), " AND ", this.connection.addFieldWrappers(new XVar("keys")), "=", this.connection.prepareString((XVar)(skeys))));
            delete((XVar)(where));
            return(null);
        }
Exemple #4
0
        public virtual XVar buildControl(dynamic _param_value, dynamic _param_mode, dynamic _param_fieldNum, dynamic _param_validate, dynamic _param_additionalCtrlParams, dynamic _param_data)
        {
            #region pass-by-value parameters
            dynamic value                = XVar.Clone(_param_value);
            dynamic mode                 = XVar.Clone(_param_mode);
            dynamic fieldNum             = XVar.Clone(_param_fieldNum);
            dynamic validate             = XVar.Clone(_param_validate);
            dynamic additionalCtrlParams = XVar.Clone(_param_additionalCtrlParams);
            dynamic data                 = XVar.Clone(_param_data);
            #endregion

            dynamic additionalClass = null, arrKeys = XVar.Array(), isHidden = null, j = null;
            this.searchPanelControl = XVar.Clone(isSearchPanelControl((XVar)(mode), (XVar)(additionalCtrlParams)));
            this.inputStyle         = XVar.Clone(getInputStyle((XVar)(mode)));
            if (XVar.Pack(fieldNum))
            {
                this.cfield = XVar.Clone(MVCFunctions.Concat("value", fieldNum, "_", this.goodFieldName, "_", this.id));
                this.ctype  = XVar.Clone(MVCFunctions.Concat("type", fieldNum, "_", this.goodFieldName, "_", this.id));
            }
            this.iquery = XVar.Clone(MVCFunctions.Concat("field=", MVCFunctions.RawUrlEncode((XVar)(this.field))));
            arrKeys     = XVar.Clone(this.pageObject.pSetEdit.getTableKeys());
            j           = new XVar(0);
            for (; j < MVCFunctions.count(arrKeys); j++)
            {
                this.keylink = MVCFunctions.Concat(this.keylink, "&key", j + 1, "=", MVCFunctions.RawUrlEncode((XVar)(data[arrKeys[j]])));
            }
            this.iquery     = MVCFunctions.Concat(this.iquery, this.keylink);
            isHidden        = XVar.Clone((XVar)(additionalCtrlParams.KeyExists("hidden")) && (XVar)(additionalCtrlParams["hidden"]));
            additionalClass = new XVar("");
            if (XVar.Pack(this.pageObject.isBootstrap()))
            {
                if (XVar.Pack(this.pageObject.isPD()))
                {
                    additionalClass = MVCFunctions.Concat(additionalClass, "bs-ctrlspan ");
                }
                else
                {
                    additionalClass = MVCFunctions.Concat(additionalClass, "bs-ctrlspan rnr-nowrap ");
                }
                if (this.format == Constants.EDIT_FORMAT_READONLY)
                {
                    additionalClass = MVCFunctions.Concat(additionalClass, "form-control-static ");
                }
                if ((XVar)(MVCFunctions.count(validate["basicValidate"])) && (XVar)(!XVar.Equals(XVar.Pack(MVCFunctions.array_search(new XVar("IsRequired"), (XVar)(validate["basicValidate"]))), XVar.Pack(false))))
                {
                    additionalClass = MVCFunctions.Concat(additionalClass, "bs-inlinerequired");
                }
            }
            else
            {
                additionalClass = MVCFunctions.Concat(additionalClass, "rnr-nowrap ");
            }
            MVCFunctions.Echo(MVCFunctions.Concat("<span id=\"edit", this.id, "_", this.goodFieldName, "_", fieldNum, "\" class=\"", additionalClass, "\"", (XVar.Pack(isHidden) ? XVar.Pack(" style=\"display:none\"") : XVar.Pack("")), ">"));
            return(null);
        }
        public override XVar showDBValue(dynamic data, dynamic _param_keylink)
        {
            #region pass-by-value parameters
            dynamic keylink = XVar.Clone(_param_keylink);
            #endregion

            dynamic fileName = null, fileNameF = null, value = null;
            if (XVar.Pack(!(XVar)(data[this.field])))
            {
                return("");
            }
            value     = new XVar("");
            fileName  = new XVar("file.jpg");
            fileNameF = XVar.Clone(this.container.pSet.getFilenameField((XVar)(this.field)));
            if ((XVar)(fileNameF) && (XVar)(data[fileNameF]))
            {
                fileName = XVar.Clone(data[fileNameF]);
            }
            if (XVar.Pack(this.showThumbnails))
            {
                dynamic hrefBegin = null, hrefEnd = null, linkClass = null, smallThumbnailStyle = null, thumbPref = null;
                thumbPref = XVar.Clone(this.container.pSet.getStrThumbnail((XVar)(this.field)));
                hrefBegin = XVar.Clone(MVCFunctions.GetTableLink(new XVar("mfhandler"), new XVar(""), (XVar)(MVCFunctions.Concat("filename=", fileName, "&table=", MVCFunctions.RawUrlEncode((XVar)(this.container.pSet._table))))));
                hrefEnd   = XVar.Clone(MVCFunctions.Concat("&nodisp=1&pageType=", this.container.pageType, keylink, "&rndVal=", MVCFunctions.rand(new XVar(0), new XVar(32768))));
                linkClass = new XVar("zoombox");
                if ((XVar)(this.thumbWidth) && (XVar)(this.thumbHeight))
                {
                    dynamic hasThumbnail = null, thumbFileUrl = null;
                    hasThumbnail        = XVar.Clone((XVar)(thumbPref != XVar.Pack("")) && (XVar)(MVCFunctions.strlen((XVar)(data[thumbPref]))));
                    thumbFileUrl        = XVar.Clone(MVCFunctions.Concat(hrefBegin, "&field=", (XVar.Pack(hasThumbnail) ? XVar.Pack(MVCFunctions.RawUrlEncode((XVar)(thumbPref))) : XVar.Pack(MVCFunctions.RawUrlEncode((XVar)(this.field)))), hrefEnd));
                    smallThumbnailStyle = XVar.Clone(getSmallThumbnailStyle((XVar)(thumbFileUrl), (XVar)(hasThumbnail)));
                    linkClass           = MVCFunctions.Concat(linkClass, " background-picture");
                }
                value = MVCFunctions.Concat(value, "<a target=_blank href='", hrefBegin, "&field=", MVCFunctions.RawUrlEncode((XVar)(this.field)), hrefEnd, "' class='", linkClass, "' ", smallThumbnailStyle, ">");
                value = MVCFunctions.Concat(value, "<img border=0 ");
                if (XVar.Pack(this.is508))
                {
                    value = MVCFunctions.Concat(value, " alt=\"Image from DB\"");
                }
                value = MVCFunctions.Concat(value, " src='", hrefBegin, "&field=", MVCFunctions.RawUrlEncode((XVar)(thumbPref)), hrefEnd, "'>");
                value = MVCFunctions.Concat(value, "</a>");
            }
            else
            {
                value = new XVar("<img class=\"bs-dbimage\" ");
                if (XVar.Pack(this.is508))
                {
                    value = MVCFunctions.Concat(value, " alt=\"Image from DB\"");
                }
                value = MVCFunctions.Concat(value, " border=0");
                value = MVCFunctions.Concat(value, getImageSizeStyle(new XVar(true)), " src='", MVCFunctions.GetTableLink(new XVar("mfhandler"), new XVar(""), (XVar)(MVCFunctions.Concat("filename=", fileName, "&table=", MVCFunctions.RawUrlEncode((XVar)(this.container.pSet._table)), "&field=", MVCFunctions.RawUrlEncode((XVar)(this.field)), "&nodisp=1", "&pageType=", this.container.pageType, keylink, "&rndVal=", MVCFunctions.rand(new XVar(0), new XVar(32768))))), "'>");
            }
            return(value);
        }
Exemple #6
0
        public virtual XVar initDPInlineParams()
        {
            dynamic i = null, strkey = null;

            strkey = new XVar("");
            i      = new XVar(0);
            for (; i < MVCFunctions.count(this.dpMasterKey); i++)
            {
                strkey = MVCFunctions.Concat(strkey, "&masterkey", i + 1, "=", MVCFunctions.RawUrlEncode((XVar)(this.dpMasterKey[i])));
            }
            this.dpParams = XVar.Clone(MVCFunctions.Concat("mode=listdetails&id=", this.id, "&mastertable=", MVCFunctions.RawUrlEncode((XVar)(this.masterTable)), strkey, (XVar.Pack(this.masterId) ? XVar.Pack(MVCFunctions.Concat("&masterid=", this.masterId)) : XVar.Pack("")), (XVar.Pack((XVar)(this.masterPageType == Constants.PAGE_EDIT) || (XVar)(this.masterPageType == Constants.PAGE_VIEW)) ? XVar.Pack(MVCFunctions.Concat("&masterpagetype=", this.masterPageType)) : XVar.Pack(""))));
            return(null);
        }
Exemple #7
0
        public virtual XVar LockRecord(dynamic _param_strtable, dynamic _param_keys)
        {
            #region pass-by-value parameters
            dynamic strtable = XVar.Clone(_param_strtable);
            dynamic keys     = XVar.Clone(_param_keys);
            #endregion

            dynamic arrDelete = XVar.Array(), data = XVar.Array(), qResult = null, sdate = null, skeys = null, where = null;
            skeys = new XVar("");
            foreach (KeyValuePair <XVar, dynamic> val in keys.GetEnumerator())
            {
                if (XVar.Pack(MVCFunctions.strlen((XVar)(skeys))))
                {
                    skeys = MVCFunctions.Concat(skeys, "&");
                }
                skeys = MVCFunctions.Concat(skeys, MVCFunctions.RawUrlEncode((XVar)(val.Value)));
            }
            sdate = XVar.Clone(MVCFunctions.now());
            insert((XVar)(strtable), (XVar)(sdate), (XVar)(sdate), (XVar)(skeys), (XVar)(MVCFunctions.session_id()), (XVar)(this.UserID), new XVar(1));
            arrDelete = XVar.Clone(XVar.Array());
            where     = XVar.Clone(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("table")), "=", this.connection.prepareString((XVar)(strtable)), " AND ", this.connection.addFieldWrappers(new XVar("keys")), "=", this.connection.prepareString((XVar)(skeys)), " AND ", this.connection.addFieldWrappers(new XVar("action")), "=1"));
            qResult   = XVar.Clone(query((XVar)(where), (XVar)(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("id")), " asc"))));
            while (XVar.Pack(data = XVar.Clone(qResult.fetchAssoc())))
            {
                if (this.UnlockTime < MVCFunctions.secondsPassedFrom((XVar)(data["confirmdatetime"])))
                {
                    arrDelete.InitAndSetArrayItem(data["id"], null);
                }
                else
                {
                    foreach (KeyValuePair <XVar, dynamic> val in arrDelete.GetEnumerator())
                    {
                        delete((XVar)(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("id")), "=", val.Value)));
                    }
                    if (data["sessionid"] == MVCFunctions.session_id())
                    {
                        return(true);
                    }
                    else
                    {
                        where = XVar.Clone(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("sessionid")), "=", this.connection.prepareString((XVar)(MVCFunctions.session_id())), " AND ", this.connection.addFieldWrappers(new XVar("action")), "=1", " AND ", this.connection.addFieldWrappers(new XVar("table")), "=", this.connection.prepareString((XVar)(strtable)), " AND ", this.connection.addFieldWrappers(new XVar("keys")), "=", this.connection.prepareString((XVar)(skeys))));
                        delete((XVar)(where));
                        return(false);
                    }
                }
            }
            return(false);
        }
Exemple #8
0
        public virtual XVar get_file_object(dynamic _param_file_name)
        {
            #region pass-by-value parameters
            dynamic file_name = XVar.Clone(_param_file_name);
            #endregion

            dynamic file_path = null;
            file_path = XVar.Clone(MVCFunctions.Concat(this.pSet.getUploadFolder((XVar)(this.field)), file_name));
            if ((XVar)(MVCFunctions.file_exists(file_path)) && (XVar)(!XVar.Equals(XVar.Pack(file_name[0]), XVar.Pack("."))))
            {
                dynamic file = XVar.Array(), path_parts = XVar.Array();
                file = XVar.Clone(XVar.Array());
                file.InitAndSetArrayItem(false, "error");
                file.InitAndSetArrayItem(file_path, "name");
                file.InitAndSetArrayItem(file_name, "usrName");
                path_parts = XVar.Clone(pathinfo_local((XVar)(file_name)));
                file.InitAndSetArrayItem(CommonFunctions.getContentTypeByExtension((XVar)(path_parts["extension"])), "type");
                file.InitAndSetArrayItem(MVCFunctions.filesize((XVar)(file_path)), "size");
                file.InitAndSetArrayItem(MVCFunctions.RawUrlEncode((XVar)(file_path)), "url");
                file.InitAndSetArrayItem("", "thumbnail");
                foreach (KeyValuePair <XVar, dynamic> options in this.options["image_versions"].GetEnumerator())
                {
                    if (XVar.Pack(file_path))
                    {
                        dynamic thumbPath = null;
                        thumbPath = XVar.Clone(MVCFunctions.Concat(this.pSet.getUploadFolder((XVar)(this.field)), this.pSet.getStrThumbnail((XVar)(this.field)), file_name));
                        if (XVar.Pack(MVCFunctions.file_exists(MVCFunctions.getabspath((XVar)(thumbPath)))))
                        {
                            file.InitAndSetArrayItem(thumbPath, "thumbnail");
                            path_parts = XVar.Clone(pathinfo_local((XVar)(thumbPath)));
                            file.InitAndSetArrayItem(CommonFunctions.getContentTypeByExtension((XVar)(path_parts["extension"])), "thumbnail_type");
                            file.InitAndSetArrayItem(MVCFunctions.filesize((XVar)(MVCFunctions.getabspath((XVar)(thumbPath)))), "thumbnail_size");
                        }
                        else
                        {
                            file.InitAndSetArrayItem(file_path, "thumbnail");
                            file.InitAndSetArrayItem(file["type"], "thumbnail_type");
                            file.InitAndSetArrayItem(file["size"], "thumbnail_size");
                        }
                    }
                }
                set_file_delete_url((XVar)(file));
                return(file);
            }
            return(null);
        }
Exemple #9
0
        public virtual XVar GetLockInfo(dynamic _param_strtable, dynamic _param_keys, dynamic _param_links, dynamic _param_pageid)
        {
            #region pass-by-value parameters
            dynamic strtable = XVar.Clone(_param_strtable);
            dynamic keys     = XVar.Clone(_param_keys);
            dynamic links    = XVar.Clone(_param_links);
            dynamic pageid   = XVar.Clone(_param_pageid);
            #endregion

            dynamic data = XVar.Array(), page = null, qResult = null, skeys = null, where = null;
            page  = XVar.Clone(MVCFunctions.GetTableLink((XVar)(CommonFunctions.GetTableURL((XVar)(strtable))), new XVar("edit")));
            skeys = new XVar("");
            foreach (KeyValuePair <XVar, dynamic> val in keys.GetEnumerator())
            {
                if (XVar.Pack(MVCFunctions.strlen((XVar)(skeys))))
                {
                    skeys = MVCFunctions.Concat(skeys, "&");
                }
                skeys = MVCFunctions.Concat(skeys, MVCFunctions.RawUrlEncode((XVar)(val.Value)));
            }
            where   = XVar.Clone(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("table")), "=", this.connection.prepareString((XVar)(strtable)), " AND ", this.connection.addFieldWrappers(new XVar("keys")), "=", this.connection.prepareString((XVar)(skeys)), " AND ", this.connection.addFieldWrappers(new XVar("sessionid")), "<>'", MVCFunctions.session_id(), "' AND ", this.connection.addFieldWrappers(new XVar("action")), "=1"));
            qResult = XVar.Clone(query((XVar)(where), (XVar)(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("id")), " asc"))));
            if (XVar.Pack(data = XVar.Clone(qResult.fetchAssoc())))
            {
                dynamic arrDateTime = null, sdate = null, str = null;
                sdate       = XVar.Clone(MVCFunctions.now());
                arrDateTime = XVar.Clone(CommonFunctions.db2time((XVar)(data["startdatetime"])));
                str         = XVar.Clone(MVCFunctions.mysprintf((XVar)(this.LockAdmin), (XVar)(new XVar(0, data["userid"], 1, (XVar)Math.Round((double)(MVCFunctions.secondsPassedFrom((XVar)(data["startdatetime"])) / 60), 2)))));
                if (XVar.Pack(links))
                {
                    str = MVCFunctions.Concat(str, "<a class=\"unlock\" href=\"#\" onclick=\"Runner.pages.PageManager.getAt('", MVCFunctions.runner_htmlspecialchars((XVar)(CommonFunctions.jsreplace((XVar)(strtable)))), "', ", pageid, ").locking.UnlockAdmin('", MVCFunctions.runner_htmlspecialchars((XVar)(CommonFunctions.jsreplace((XVar)(skeys)))), "','", data["sessionid"], "','no');return false;\">", "Desbloquear registro", "</a>");
                    str = MVCFunctions.Concat(str, "<a class=\"edit\" href=\"#\" onclick=\"Runner.pages.PageManager.getAt('", MVCFunctions.runner_htmlspecialchars((XVar)(CommonFunctions.jsreplace((XVar)(strtable)))), "', ", pageid, ").locking.UnlockAdmin('", MVCFunctions.runner_htmlspecialchars((XVar)(CommonFunctions.jsreplace((XVar)(skeys)))), "','", data["sessionid"], "','yes');return false;\">", "Editar registro", "</a>");
                }
                return(str);
            }
            return("");
        }
Exemple #10
0
        public static XVar saveRedirectURL()
        {
            dynamic query = null, url = null;

            url   = XVar.Clone(MVCFunctions.GetScriptName());
            query = new XVar("");
            foreach (KeyValuePair <XVar, dynamic> value in MVCFunctions.EnumeratePOST())
            {
                if ((XVar)(value.Key == "a") && (XVar)(value.Value == "logout"))
                {
                    continue;
                }
                if (query != XVar.Pack(""))
                {
                    query = MVCFunctions.Concat(query, "&");
                }
                if (XVar.Pack(MVCFunctions.is_array((XVar)(value.Value))))
                {
                    query = MVCFunctions.Concat(query, MVCFunctions.RawUrlEncode((XVar)(MVCFunctions.Concat(value.Key, "[]"))), "=");
                    query = MVCFunctions.Concat(query, MVCFunctions.implode((XVar)(MVCFunctions.Concat(MVCFunctions.RawUrlEncode((XVar)(MVCFunctions.Concat(value.Key, "[]"))), "=")), (XVar)(value.Value)));
                }
                else
                {
                    query = MVCFunctions.Concat(query, MVCFunctions.RawUrlEncode((XVar)(value.Key)));
                    if (XVar.Pack(MVCFunctions.strlen((XVar)(value.Value))))
                    {
                        query = MVCFunctions.Concat(query, "=", MVCFunctions.RawUrlEncode((XVar)(value.Value)));
                    }
                }
            }
            if (query != XVar.Pack(""))
            {
                url = MVCFunctions.Concat(url, "?", query);
            }
            XSession.Session["MyURL"] = url;
            return(null);
        }
Exemple #11
0
        protected virtual XVar getControlHTML(dynamic _param_value, dynamic _param_showValue, dynamic _param_dataValue, dynamic _param_totalValue, dynamic _param_separator, dynamic _param_parentFiltersData = null)
        {
            #region default values
            if (_param_parentFiltersData as Object == null)
            {
                _param_parentFiltersData = new XVar();
            }
            #endregion

            #region pass-by-value parameters
            dynamic value             = XVar.Clone(_param_value);
            dynamic showValue         = XVar.Clone(_param_showValue);
            dynamic dataValue         = XVar.Clone(_param_dataValue);
            dynamic totalValue        = XVar.Clone(_param_totalValue);
            dynamic separator         = XVar.Clone(_param_separator);
            dynamic parentFiltersData = XVar.Clone(_param_parentFiltersData);
            #endregion

            dynamic encodeDataValue = null, extraDataAttrs = null, filterControl = null, label = null, pageType = null;
            filterControl   = new XVar("");
            encodeDataValue = XVar.Clone(MVCFunctions.runner_htmlspecialchars((XVar)(dataValue)));
            extraDataAttrs  = XVar.Clone(getExtraDataAttrs((XVar)(parentFiltersData)));
            pageType        = new XVar("list");
            if (Constants.titREPORT == this.pSet.getEntityType())
            {
                pageType = new XVar("report");
            }
            else
            {
                if (Constants.titCHART == this.pSet.getEntityType())
                {
                    pageType = new XVar("chart");
                }
            }
            if (this.multiSelect != Constants.FM_NONE)
            {
                dynamic checkBox = null, checkedAttr = null, style = null;
                style         = XVar.Clone((XVar.Pack((XVar)(this.filtered) || (XVar)(this.multiSelect == Constants.FM_ALWAYS)) ? XVar.Pack("") : XVar.Pack("style=\"display: none;\"")));
                checkedAttr   = XVar.Clone(getCheckedAttr((XVar)(value), (XVar)(parentFiltersData)));
                checkBox      = XVar.Clone(MVCFunctions.Concat("<input type=\"checkbox\" ", checkedAttr, " name=\"f[]\" value=\"", encodeDataValue, "\" ", extraDataAttrs, " class=\"multifilter-checkbox filter_", this.gfName, "_", this.id, "\" ", style, ">"));
                filterControl = MVCFunctions.Concat(filterControl, checkBox, "&nbsp;");
            }
            if (this.multiSelect != Constants.FM_ALWAYS)
            {
                dynamic href = null;
                href  = XVar.Clone(MVCFunctions.GetTableLink((XVar)(CommonFunctions.GetTableURL((XVar)(this.tName))), (XVar)(pageType), (XVar)(MVCFunctions.Concat("f=(", MVCFunctions.runner_htmlspecialchars((XVar)(MVCFunctions.RawUrlEncode((XVar)(this.fName)))), separator, encodeDataValue, ")"))));
                label = XVar.Clone(MVCFunctions.Concat("<a href=\"", href, "\" data-filtervalue=\"", encodeDataValue, "\" ", extraDataAttrs, " class=\"", this.gfName, "-filter-value\">", showValue, "</a>"));
            }
            else
            {
                label = XVar.Clone(MVCFunctions.Concat("<span>", showValue, "</span>"));
            }
            if ((XVar)(this.useTotals) && (XVar)(totalValue != XVar.Pack("")))
            {
                label = MVCFunctions.Concat(label, "<span>&nbsp;(", totalValue, ")</span>");
            }
            filterControl = MVCFunctions.Concat(filterControl, "<span dir=\"LTR\">", label, "</span>");
            return(filterControl);
        }
Exemple #12
0
        public override XVar showDBValue(dynamic data, dynamic _param_keylink, dynamic _param_html = null)
        {
            #region default values
            if (_param_html as Object == null)
            {
                _param_html = new XVar(true);
            }
            #endregion

            #region pass-by-value parameters
            dynamic keylink = XVar.Clone(_param_keylink);
            dynamic html    = XVar.Clone(_param_html);
            #endregion

            dynamic fileName = null, value = null;
            value    = new XVar("");
            fileName = XVar.Clone(getFileName((XVar)(data)));
            if (XVar.Pack(MVCFunctions.strlen((XVar)(data[this.field]))))
            {
                value = XVar.Clone(MVCFunctions.Concat("<a href='", MVCFunctions.GetTableLink(new XVar("getfile"), new XVar(""), (XVar)(MVCFunctions.Concat("table=", CommonFunctions.GetTableURL((XVar)(this.container.pSet._table)), "&filename=", MVCFunctions.RawUrlEncode((XVar)(fileName)), "&pagename=", MVCFunctions.runner_htmlspecialchars((XVar)(this.container.pSet.pageName())), "&field=", MVCFunctions.RawUrlEncode((XVar)(this.field)), keylink))), "'>"));
                value = MVCFunctions.Concat(value, MVCFunctions.runner_htmlspecialchars((XVar)(fileName)));
                value = MVCFunctions.Concat(value, "</a>");
            }
            return(value);
        }
        public override XVar showDBValue(dynamic data, dynamic _param_keylink)
        {
            #region pass-by-value parameters
            dynamic keylink = XVar.Clone(_param_keylink);
            #endregion

            dynamic title = null, titleField = null, value = null;
            value      = new XVar("");
            title      = new XVar("");
            titleField = XVar.Clone(this.container.pSet.getAudioTitleField((XVar)(this.field)));
            if (XVar.Pack(titleField))
            {
                title = XVar.Clone(MVCFunctions.runner_htmlspecialchars((XVar)(data[titleField])));
            }
            if ((XVar)(data[this.field] != null) && (XVar)(this.container.pageType != Constants.PAGE_PRINT))
            {
                dynamic href = null, link = null;
                if (XVar.Pack(!(XVar)(title)))
                {
                    title = new XVar("Track.mp3");
                }
                href  = XVar.Clone(MVCFunctions.GetTableLink(new XVar("getfile"), new XVar(""), (XVar)(MVCFunctions.Concat("table=", CommonFunctions.GetTableURL((XVar)(this.container.pSet._table)), "&field=", MVCFunctions.RawUrlEncode((XVar)(this.field)), keylink, "&filename=", title))));
                link  = XVar.Clone(MVCFunctions.Concat("<a title=\"", title, "\" href=\"", href, "\">", title, "</a>"));
                value = XVar.Clone(MVCFunctions.Concat("<audio controls preload=\"none\" src=\"", href, "\">", link, "</audio>"));
            }
            else
            {
                value = XVar.Clone(title);
            }
            return(value);
        }
Exemple #14
0
        public override XVar fillGridData()
        {
            dynamic data = XVar.Array(), editlink = null, keys = XVar.Array(), recNum = null, tKeys = XVar.Array(), var_params = XVar.Array();

            if (XVar.Pack(this.gridBased))
            {
                return(null);
            }
            data   = XVar.Clone(beforeProccessRow());
            tKeys  = XVar.Clone(this.pSet.getTableKeys());
            recNum = XVar.Clone((XVar.Pack((XVar)(hasTableDashGridElement()) || (XVar)(MVCFunctions.strlen((XVar)(this.masterTable)))) ? XVar.Pack(this.pageSize) : XVar.Pack(this.dashElementData["mapMarkerCount"])));
            if ((XVar)(!(XVar)(this.mapRefresh)) && (XVar)((XVar)(this.dashElementData["clustering"]) || (XVar)(this.dashElementData["heatMap"])))
            {
                recNum = new XVar(10000);
            }
            while ((XVar)(data) && (XVar)((XVar)(this.recNo <= recNum) || (XVar)(recNum == -1)))
            {
                genId();
                keys       = XVar.Clone(XVar.Array());
                var_params = XVar.Clone(XVar.Array());
                foreach (KeyValuePair <XVar, dynamic> fKey in tKeys.GetEnumerator())
                {
                    keys.InitAndSetArrayItem(data[fKey.Value], 0);
                    var_params.InitAndSetArrayItem(MVCFunctions.Concat("editid", fKey.Key + 1, "=", MVCFunctions.runner_htmlspecialchars((XVar)(MVCFunctions.RawUrlEncode((XVar)(data[fKey.Value]))))), null);
                }
                editlink = XVar.Clone(MVCFunctions.implode(new XVar("&"), (XVar)(var_params)));
                addBigGoogleMapMarkers((XVar)(data), (XVar)(keys), (XVar)(editlink));
                data = XVar.Clone(beforeProccessRow());
                this.recNo++;
            }
            return(null);
        }
Exemple #15
0
        public override XVar showDBValue(dynamic data, dynamic _param_keylink)
        {
            #region pass-by-value parameters
            dynamic keylink = XVar.Clone(_param_keylink);
            #endregion

            dynamic fileName = null, fileNameF = null, value = null;
            value     = new XVar("");
            fileNameF = XVar.Clone(this.container.pSet.getFilenameField((XVar)(this.field)));
            if (XVar.Pack(fileNameF))
            {
                fileName = XVar.Clone(data[fileNameF]);
                if (XVar.Pack(!(XVar)(fileName)))
                {
                    fileName = new XVar("file.bin");
                }
            }
            else
            {
                fileName = new XVar("file.bin");
            }
            if (XVar.Pack(MVCFunctions.strlen((XVar)(data[this.field]))))
            {
                value = XVar.Clone(MVCFunctions.Concat("<a href='", MVCFunctions.GetTableLink(new XVar("getfile"), new XVar(""), (XVar)(MVCFunctions.Concat("table=", CommonFunctions.GetTableURL((XVar)(this.container.pSet._table)), "&filename=", MVCFunctions.RawUrlEncode((XVar)(fileName)), "&field=", MVCFunctions.RawUrlEncode((XVar)(this.field)), keylink))), "'>"));
                value = MVCFunctions.Concat(value, MVCFunctions.runner_htmlspecialchars((XVar)(fileName)));
                value = MVCFunctions.Concat(value, "</a>");
            }
            return(value);
        }
Exemple #16
0
        public override XVar showDBValue(dynamic data, dynamic _param_keylink, dynamic _param_html = null)
        {
            #region default values
            if (_param_html as Object == null)
            {
                _param_html = new XVar(true);
            }
            #endregion

            #region pass-by-value parameters
            dynamic keylink = XVar.Clone(_param_keylink);
            dynamic html    = XVar.Clone(_param_html);
            #endregion

            dynamic fileName = null, fileNameF = null, value = null;
            value = new XVar("");
            if ((XVar)(data[this.field] != null) && (XVar)(this.container.pageType != Constants.PAGE_PRINT))
            {
                dynamic href = null, vHeight = null, vWidth = null, var_type = null, videoId = null;
                videoId = XVar.Clone(MVCFunctions.Concat("video_", MVCFunctions.GoodFieldName((XVar)(MVCFunctions.runner_htmlspecialchars((XVar)(this.field)))), "_"));
                videoId = MVCFunctions.Concat(videoId, getContainer().id, "_");
                if (getContainer().pageType != Constants.PAGE_ADD)
                {
                    videoId = MVCFunctions.Concat(videoId, getContainer().recId);
                }
                else
                {
                    videoId = MVCFunctions.Concat(videoId, CommonFunctions.postvalue_number(new XVar("id")));
                }
                var_type  = new XVar("video/mp4");
                fileName  = new XVar("file.mp4");
                fileNameF = XVar.Clone(getContainer().pSet.getFilenameField((XVar)(this.field)));
                if (XVar.Pack(fileNameF))
                {
                    fileName = XVar.Clone(data[fileNameF]);
                    if (XVar.Pack(!(XVar)(fileName)))
                    {
                        fileName = new XVar("file.mp4");
                    }
                    else
                    {
                        var_type = XVar.Clone(CommonFunctions.getContentTypeByExtension((XVar)(MVCFunctions.substr((XVar)(fileName), (XVar)(MVCFunctions.strrpos((XVar)(fileName), new XVar(".")))))));
                    }
                }
                href    = XVar.Clone(MVCFunctions.GetTableLink(new XVar("mfhandler"), new XVar(""), (XVar)(MVCFunctions.Concat("filename=", fileName, "&table=", MVCFunctions.RawUrlEncode((XVar)(getContainer().pSet._table)), "&field=", MVCFunctions.RawUrlEncode((XVar)(this.field)), "&pageType=", getContainer().pageType, keylink))));
                vWidth  = XVar.Clone(getContainer().pSet.getVideoWidth((XVar)(this.field)));
                vHeight = XVar.Clone(getContainer().pSet.getVideoHeight((XVar)(this.field)));
                if (vWidth == XVar.Pack(0))
                {
                    vWidth = new XVar(300);
                }
                if (vHeight == XVar.Pack(0))
                {
                    vHeight = new XVar(200);
                }
                value = MVCFunctions.Concat(value, "\r\n\t\t\t\t<div style=\"width:", vWidth, "px; height:", vHeight, "px;\">\r\n\t\t\t\t<video class=\"projekktor\" width=\"", vWidth, "\" height=\"", vHeight, "\" id=\"", videoId, "\" type=\"", var_type, "\" src=\"", href, "\" >\r\n\t\t\t\t</video></div>");
                if (this.pageObject != null)
                {
                    this.pageObject.controlsMap.InitAndSetArrayItem(videoId, "video", null);
                }
            }
            else
            {
                fileNameF = XVar.Clone(getContainer().pSet.getFilenameField((XVar)(this.field)));
                if (XVar.Pack(fileNameF))
                {
                    fileName = XVar.Clone(data[fileNameF]);
                    if (XVar.Pack(!(XVar)(fileName)))
                    {
                        value = XVar.Clone(fileName);
                    }
                }
            }
            return(value);
        }
Exemple #17
0
        public override XVar buildControl(dynamic _param_value, dynamic _param_mode, dynamic _param_fieldNum, dynamic _param_validate, dynamic _param_additionalCtrlParams, dynamic _param_data)
        {
            #region pass-by-value parameters
            dynamic value                = XVar.Clone(_param_value);
            dynamic mode                 = XVar.Clone(_param_mode);
            dynamic fieldNum             = XVar.Clone(_param_fieldNum);
            dynamic validate             = XVar.Clone(_param_validate);
            dynamic additionalCtrlParams = XVar.Clone(_param_additionalCtrlParams);
            dynamic data                 = XVar.Clone(_param_data);
            #endregion

            dynamic filesArray = XVar.Array(), jsonValue = null, multiple = null, userFilesArray = XVar.Array();
            base.buildControl((XVar)(value), (XVar)(mode), (XVar)(fieldNum), (XVar)(validate), (XVar)(additionalCtrlParams), (XVar)(data));
            if ((XVar)(this.pageObject.pageType == Constants.PAGE_SEARCH) || (XVar)(this.pageObject.pageType == Constants.PAGE_LIST))
            {
                dynamic classString = null;
                classString = new XVar("");
                if (XVar.Pack(this.pageObject.isBootstrap()))
                {
                    classString = new XVar(" class=\"form-control\"");
                }
                MVCFunctions.Echo(MVCFunctions.Concat("<input id=\"", this.cfield, "\" ", classString, this.inputStyle, " type=\"text\" ", (XVar.Pack(mode == Constants.MODE_SEARCH) ? XVar.Pack("autocomplete=\"off\" ") : XVar.Pack("")), (XVar.Pack((XVar)((XVar)(mode == Constants.MODE_INLINE_EDIT) || (XVar)(mode == Constants.MODE_INLINE_ADD)) && (XVar)(this.is508 == true)) ? XVar.Pack(MVCFunctions.Concat("alt=\"", this.strLabel, "\" ")) : XVar.Pack("")), "name=\"", this.cfield, "\" ", this.pageObject.pSetEdit.getEditParams((XVar)(this.field)), " value=\"", MVCFunctions.runner_htmlspecialchars((XVar)(value)), "\">"));
                buildControlEnd((XVar)(validate), (XVar)(mode));
                return(null);
            }
            if (mode == Constants.MODE_SEARCH)
            {
                this.format = new XVar("");
            }
            this.formStamp = XVar.Clone(CommonFunctions.generatePassword(new XVar(15)));
            initUploadHandler();
            this.upload_handler.formStamp = XVar.Clone(this.formStamp);
            filesArray = XVar.Clone(MVCFunctions.my_json_decode((XVar)(value)));
            if ((XVar)(!(XVar)(MVCFunctions.is_array((XVar)(filesArray)))) || (XVar)(MVCFunctions.count(filesArray) == 0))
            {
                if (XVar.Pack(!(XVar)(value)))
                {
                    jsonValue = new XVar("[]");
                }
                else
                {
                    dynamic uploadedFile = null;
                    uploadedFile = XVar.Clone(this.upload_handler.get_file_object((XVar)(value)));
                    if (XVar.Pack(uploadedFile == null))
                    {
                        filesArray = XVar.Clone(XVar.Array());
                    }
                    else
                    {
                        filesArray = XVar.Clone(new XVar(0, MVCFunctions.my_json_decode((XVar)(MVCFunctions.my_json_encode((XVar)(uploadedFile))))));
                    }
                }
            }
            if (this.pageObject.pageType == Constants.PAGE_EDIT)
            {
                if (0 < MVCFunctions.count(this.pageObject.keys))
                {
                    dynamic i = null;
                    i = new XVar(1);
                    foreach (KeyValuePair <XVar, dynamic> keyValue in this.pageObject.keys.GetEnumerator())
                    {
                        this.upload_handler.tkeys = MVCFunctions.Concat(this.upload_handler.tkeys, "&key", i, "=", MVCFunctions.RawUrlEncode((XVar)(keyValue.Value)));
                        i++;
                    }
                }
            }
            XSession.Session[MVCFunctions.Concat("mupload_", this.formStamp)] = XVar.Array();
            userFilesArray = XVar.Clone(XVar.Array());
            if (XVar.Pack(MVCFunctions.is_array((XVar)(filesArray))))
            {
                foreach (KeyValuePair <XVar, dynamic> file in filesArray.GetEnumerator())
                {
                    dynamic sessionArray = XVar.Array(), userFile = XVar.Array();
                    sessionArray = XVar.Clone(XVar.Array());
                    sessionArray.InitAndSetArrayItem(file.Value, "file");
                    sessionArray.InitAndSetArrayItem(true, "fromDB");
                    sessionArray.InitAndSetArrayItem(false, "deleted");
                    XSession.Session.InitAndSetArrayItem(sessionArray, MVCFunctions.Concat("mupload_", this.formStamp), file.Value["usrName"]);
                    userFile = XVar.Clone(this.upload_handler.buildUserFile((XVar)(file.Value)));
                    if (XVar.Pack(!(XVar)(userFile["isImg"])))
                    {
                        userFile.InitAndSetArrayItem(true, "isImg");
                        userFile.InitAndSetArrayItem(true, "isIco");
                        userFile.InitAndSetArrayItem(MVCFunctions.Concat(userFile["url"], "&icon=1"), "thumbnail_url");
                    }
                    userFilesArray.InitAndSetArrayItem(userFile, null);
                }
            }
            jsonValue = XVar.Clone(MVCFunctions.my_json_encode((XVar)(userFilesArray)));
            multiple  = new XVar("");
            if ((XVar)(!(XVar)(CommonFunctions.isIOS())) && (XVar)(this.pageObject.pSetEdit.getMaxNumberOfFiles((XVar)(this.field)) != 1))
            {
                multiple = new XVar("multiple ");
            }
            MVCFunctions.Echo(MVCFunctions.Concat("\r\n <!-- The file upload form used as target for the file upload widget -->\r\n    <form id=\"fileupload_", this.cfieldname, "\" action=\"", MVCFunctions.GetTableLink(new XVar("mfhandler")), "\" method=\"POST\" enctype=\"multipart/form-data\">\r\n    \r\n    <input type=\"hidden\" name=\"formStamp_", this.cfieldname, "\" id=\"formStamp_", this.cfieldname, "\" value=\"", this.formStamp, "\" />\r\n    <input type=\"hidden\" name=\"_action\" value=\"POST\" />\r\n    <input type=\"hidden\" id=\"value_", this.cfieldname, "\" name=\"value_", this.cfieldname, "\" value=\"", MVCFunctions.runner_htmlspecialchars((XVar)(jsonValue)), "\" />\r\n    \r\n    <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->\r\n        <div class=\"fileupload-buttonbar\">\r\n            <div class=\"span7\">\r\n                <!-- The fileinput-button span is used to style the file input field as button -->\r\n \t\t\t\t<SPAN class=\"btn btn-primary btn-sm fileinput-button\">\r\n\t\t\t\t\t<A class=\"rnr-button filesUpload button\" href=\"#\" ><input class=\"fileinput-button-input\" type=\"file\" name=\"files[]\" value=\"", "Añadir ficheros", "\" ", multiple, " />", "Añadir ficheros", "</A>\r\n\t\t\t\t</SPAN>", "\r\n                \r\n            </div>\r\n            <!-- The global progress information -->\r\n            <div class=\"fileupload-progress fade\">\r\n                <!-- The global progress bar -->\r\n                <div class=\"progress\" role=\"progressbar\" aria-valuemin=\"0\" aria-valuenow=\"0\" aria-valuemax=\"100\">\r\n                    <div style=\"width:0;\" class=\"bar progress-bar progress-bar-info progress-bar-striped active\"  ></div>\r\n                </div>\r\n                <!-- The extended global progress information -->\r\n                <div class=\"progress-extended\">&nbsp;</div>\r\n            </div>\r\n        </div>\r\n        <!-- The loading indicator is shown during file processing -->\r\n        <div class=\"fileupload-loading\"></div>\r\n        <!-- The table listing the files available for upload/download -->\r\n        <table class=\"mupload-files\"><tbody class=\"files\"></tbody></table>\r\n    </form>\r\n    "));
            if (XVar.Pack(!(XVar)(this.container.globalVals.KeyExists("muploadTemplateIncluded"))))
            {
                MVCFunctions.Echo(MVCFunctions.Concat("<script type=\"text/x-tmpl\" id=\"template-download\">{% for (var i=0, file; file=o.files[i]; i++) { %}\r\n    <tr class=\"template-download fade\">\r\n        {% if (file.error) { %}\r\n            <td></td>\r\n            <td class=\"name\"><span class=\"text-muted\">{%=file.name%}</span></td>\r\n            <td class=\"size\"><span class=\"text-muted\" dir=\"LTR\">{%=o.formatFileSize(file.size)%}</span></td>\r\n            <td colspan=2 class=\"error\"><span class=\"text-danger rnr-error\">", "", " {%=locale.fileupload.errors[file.error] || file.error%}</span></td>\r\n        {% } else { %}\r\n            <td class=\"preview\">{% if (file.thumbnail_url) { %}\r\n                <a href=\"{%=file.url%}\" title=\"{%=file.name%}\" rel=\"gallery\" download=\"{%=file.name%}\" \r\n                \t{% if (!file.isIco) { %} class=\"zoombox zgallery\" {% } %} \r\n                \t><img class=\"mupload-preview-img\" src=\"{%=file.thumbnail_url%}&src=1\"></a>\r\n            {% } else { %}\r\n            \t{% if (file.isImg) { %}\r\n            \t\t<a href=\"{%=file.url%}&nodisp=1\" title=\"{%=file.name%}\" rel=\"gallery\" download=\"{%=file.name%}\" class=\"zoombox zgallery\"><img class=\"mupload-preview-img\" src=\"{%=file.url%}&src=1\"></a>\r\n            \t{% } %}\r\n            {% } %}</td>\r\n            <td class=\"name\">\r\n                <a href=\"{%=file.url%}\" title=\"{%=file.name%}\" rel=\"{%=file.thumbnail_url&&'gallery'%}\" download=\"{%=file.name%}\">{%=file.name%}</a>\r\n            </td>\r\n            <td class=\"size\"><span dir=\"LTR\">{%=o.formatFileSize(file.size)%}</span></td>\r\n\t\t\t<td></td>\r\n\t\t\t<td class=\"delete\">\r\n\t\t\t\t{% if (!file.error) { %}\r\n\t\t\t\t<SPAN class=\"btn btn-xs btn-default delete\" data-type=\"{%=file.delete_type%}\" data-url=\"{%=file.delete_url%}\" data-name=\"{%=file.name%}\">\r\n\t\t\t\t\t<A href=\"#\" >", "Borrar artículos seleccionados", "</A>\r\n\t\t\t\t\t</SPAN>\r\n\t\t\t\t{% } %}\r\n\t\t\t</td>\r\n        {% } %}\r\n    </tr>\r\n{% } %}\r\n</script>\r\n<script type=\"text/x-tmpl\" id=\"template-upload\">{% for (var i=0, file; file=o.files[i]; i++) { %}\r\n    <tr class=\"template-upload fade\">\r\n        <td class=\"preview\"><span class=\"fade\"></span></td>\r\n        {% if (file.error) { %}\r\n\t\t\t<td class=\"name\"><span class=\"text-muted\">{%=file.name%}</span></td>\r\n\t\t\t<td class=\"size\"><span class=\"text-muted\">{%=o.formatFileSize(file.size)%}</span></td>\r\n            <td class=\"error\" colspan=\"2\"><span class=\"text-danger rnr-error\">", "", " {%=locale.fileupload.errors[file.error] || file.error%}</span></td>\r\n        {% } else if (o.files.valid && !i) { %}\r\n\t\t\t<td class=\"name\"><span>{%=file.name%}</span></td>\r\n\t\t\t<td class=\"size\"><span>{%=o.formatFileSize(file.size)%}</span></td>\r\n            <td>\r\n                <div class=\"progress progress-success progress-striped active\" role=\"progressbar\" aria-valuemin=\"0\" \r\n                \taria-valuemax=\"100\" aria-valuenow=\"0\"><div class=\"progress-bar bar\" style=\"width:0;\"></div></div>\r\n            </td>\r\n        {% } else { %}\r\n            <td></td>\r\n        {% } %}\r\n        <td class=\"cancel\">{% if (!i) { %}\r\n        \t{% if (!file.error) { %}\r\n        \t<SPAN class=\"btn btn-default btn-xs\">\r\n\t\t\t\t<A href=\"#\" >", "Cancelar", "</A>\r\n\t\t\t\t</SPAN>\r\n\t\t\t{% } %}\r\n        {% } %}</td>\r\n    </tr>\r\n{% } %}</script>"));
                this.container.globalVals.InitAndSetArrayItem(true, "muploadTemplateIncluded");
            }
            buildControlEnd((XVar)(validate), (XVar)(mode));
            return(null);
        }
Exemple #18
0
        public override XVar buildControl(dynamic _param_value, dynamic _param_mode, dynamic _param_fieldNum, dynamic _param_validate, dynamic _param_additionalCtrlParams, dynamic _param_data)
        {
            #region pass-by-value parameters
            dynamic value                = XVar.Clone(_param_value);
            dynamic mode                 = XVar.Clone(_param_mode);
            dynamic fieldNum             = XVar.Clone(_param_fieldNum);
            dynamic validate             = XVar.Clone(_param_validate);
            dynamic additionalCtrlParams = XVar.Clone(_param_additionalCtrlParams);
            dynamic data                 = XVar.Clone(_param_data);
            #endregion

            dynamic disp = null, strfilename = null, strtype = null;
            base.buildControl((XVar)(value), (XVar)(mode), (XVar)(fieldNum), (XVar)(validate), (XVar)(additionalCtrlParams), (XVar)(data));
            disp        = new XVar("");
            strfilename = new XVar("");
            if ((XVar)(mode == Constants.MODE_EDIT) || (XVar)(mode == Constants.MODE_INLINE_EDIT))
            {
                dynamic filename = null, itype = null;
                value = XVar.Clone(this.connection.stripSlashesBinary((XVar)(value)));
                itype = XVar.Clone(MVCFunctions.SupposeImageType((XVar)(value)));
                if (XVar.Pack(itype))
                {
                    if (XVar.Pack(this.pageObject.pSetEdit.showThumbnail((XVar)(this.field))))
                    {
                        disp = new XVar("<a target=_blank");
                        disp = MVCFunctions.Concat(disp, " href=\"", MVCFunctions.GetTableLink(new XVar("imager"), new XVar(""), (XVar)(MVCFunctions.Concat("table=", CommonFunctions.GetTableURL((XVar)(this.pageObject.tName)), "&", this.iquery, "&rndVal=", MVCFunctions.rand(new XVar(0), new XVar(32768))))), "\" class='zoombox'>");
                        disp = MVCFunctions.Concat(disp, "<img id=\"image_", MVCFunctions.GoodFieldName((XVar)(this.field)), "_", this.id, "\" name=\"", this.cfield, "\" border=0");
                        if (XVar.Pack(this.is508))
                        {
                            disp = MVCFunctions.Concat(disp, " alt=\"Image from DB\"");
                        }
                        disp = MVCFunctions.Concat(disp, " src=\"", MVCFunctions.GetTableLink(new XVar("imager"), new XVar(""), (XVar)(MVCFunctions.Concat("table=", CommonFunctions.GetTableURL((XVar)(this.pageObject.tName)), "&field=", MVCFunctions.RawUrlEncode((XVar)(this.pageObject.pSetEdit.getStrThumbnail((XVar)(this.field)))), "&alt=", MVCFunctions.RawUrlEncode((XVar)(this.field)), this.keylink, "&rndVal=", MVCFunctions.rand(new XVar(0), new XVar(32768))))), "\">");
                        disp = MVCFunctions.Concat(disp, "</a>");
                    }
                    else
                    {
                        disp = XVar.Clone(MVCFunctions.Concat("<img id=\"image_", MVCFunctions.GoodFieldName((XVar)(this.field)), "_", this.id, "\" name=\"", this.cfield, "\""));
                        if (XVar.Pack(this.is508))
                        {
                            disp = MVCFunctions.Concat(disp, " alt=\"Image from DB\"");
                        }
                        disp = MVCFunctions.Concat(disp, " border=0 src=\"", MVCFunctions.GetTableLink(new XVar("imager"), new XVar(""), (XVar)(MVCFunctions.Concat("table=", CommonFunctions.GetTableURL((XVar)(this.pageObject.tName)), "&", this.iquery, "&src=1&rndVal=", MVCFunctions.rand(new XVar(0), new XVar(32768))))), "\">");
                    }
                }
                else
                {
                    if (XVar.Pack(MVCFunctions.strlen((XVar)(value))))
                    {
                        disp = XVar.Clone(MVCFunctions.Concat("<img id=\"image_", MVCFunctions.GoodFieldName((XVar)(this.field)), "_", this.id, "\" name=\"", this.cfield, "\" border=0 "));
                        if (XVar.Pack(this.is508))
                        {
                            disp = MVCFunctions.Concat(disp, " alt=\"file\"");
                        }
                        disp = MVCFunctions.Concat(disp, " src=\"", MVCFunctions.GetRootPathForResources(new XVar("images/file.gif")), "\">");
                    }
                }
                if ((XVar)((XVar)(this.format == Constants.EDIT_FORMAT_DATABASE_FILE) && (XVar)(!(XVar)(itype))) && (XVar)(MVCFunctions.strlen((XVar)(value))))
                {
                    if (XVar.Pack(!(XVar)(filename = XVar.Clone(data[this.pageObject.pSetEdit.getFilenameField((XVar)(this.field))]))))
                    {
                        filename = new XVar("file.bin");
                    }
                    disp = XVar.Clone(MVCFunctions.Concat("<a href=\"", MVCFunctions.GetTableLink(new XVar("getfile"), new XVar(""), (XVar)(MVCFunctions.Concat("table=", CommonFunctions.GetTableURL((XVar)(this.pageObject.tName)), "&filename=", MVCFunctions.runner_htmlspecialchars((XVar)(filename)), "&", this.iquery))), "\".>", disp, "</a>"));
                }
                if ((XVar)(this.format == Constants.EDIT_FORMAT_DATABASE_FILE) && (XVar)(this.pageObject.pSetEdit.getFilenameField((XVar)(this.field))))
                {
                    if (XVar.Pack(!(XVar)(filename = XVar.Clone(data[this.pageObject.pSetEdit.getFilenameField((XVar)(this.field))]))))
                    {
                        filename = new XVar("");
                    }
                    if (mode == Constants.MODE_INLINE_EDIT)
                    {
                        strfilename = XVar.Clone(MVCFunctions.Concat("<br><label for=\"filename_", this.cfieldname, "\">", "Filename", "</label>&nbsp;&nbsp;<input type=\"text\" ", this.inputStyle, " id=\"filename_", this.cfieldname, "\" name=\"filename_", this.cfieldname, "\" size=\"20\" maxlength=\"50\" value=\"", MVCFunctions.runner_htmlspecialchars((XVar)(filename)), "\">"));
                    }
                    else
                    {
                        strfilename = XVar.Clone(MVCFunctions.Concat("<br><label for=\"filename_", this.cfieldname, "\">", "Filename", "</label>&nbsp;&nbsp;<input type=\"text\" ", this.inputStyle, " id=\"filename_", this.cfieldname, "\" name=\"filename_", this.cfieldname, "\" size=\"20\" maxlength=\"50\" value=\"", MVCFunctions.runner_htmlspecialchars((XVar)(filename)), "\">"));
                    }
                }
                if (XVar.Pack(MVCFunctions.strlen((XVar)(value))))
                {
                    strtype = XVar.Clone(MVCFunctions.Concat("<br><input id=\"", this.ctype, "_keep\" type=\"Radio\" name=\"", this.ctype, "\" value=\"file0\" checked class=\"rnr-uploadtype\">", "Keep"));
                    if ((XVar)(MVCFunctions.strlen((XVar)(value))) && (XVar)(!(XVar)(this.pageObject.pSetEdit.isRequired((XVar)(this.field)))))
                    {
                        strtype = MVCFunctions.Concat(strtype, "<input id=\"", this.ctype, "_delete\" type=\"Radio\" name=\"", this.ctype, "\" value=\"file1\" class=\"rnr-uploadtype\">", "Delete");
                    }
                    strtype = MVCFunctions.Concat(strtype, "<input id=\"", this.ctype, "_update\" type=\"Radio\" name=\"", this.ctype, "\" value=\"file2\" class=\"rnr-uploadtype\">", "Update");
                }
                else
                {
                    strtype = XVar.Clone(MVCFunctions.Concat("<input id=\"", this.ctype, "_update\" type=\"hidden\" name=\"", this.ctype, "\" value=\"file2\" class=\"rnr-uploadtype\">"));
                }
            }
            else
            {
                strtype = XVar.Clone(MVCFunctions.Concat("<input id=\"", this.ctype, "\" type=\"hidden\" name=\"", this.ctype, "\" value=\"file2\">"));
                if ((XVar)(this.format == Constants.EDIT_FORMAT_DATABASE_FILE) && (XVar)(this.pageObject.pSetEdit.getFilenameField((XVar)(this.field))))
                {
                    strfilename = XVar.Clone(MVCFunctions.Concat("<br><label for=\"filename_", this.cfieldname, "\">", "Filename", "</label>&nbsp;&nbsp;<input type=\"text\" ", this.inputStyle, " id=\"filename_", this.cfieldname, "\" name=\"filename_", this.cfieldname, "\" size=\"20\" maxlength=\"50\">"));
                }
            }
            if ((XVar)(mode == Constants.MODE_INLINE_EDIT) && (XVar)(this.format == Constants.EDIT_FORMAT_DATABASE_FILE))
            {
                disp = new XVar("");
            }
            MVCFunctions.Echo(MVCFunctions.Concat(disp, strtype));
            if ((XVar)((XVar)(mode == Constants.MODE_EDIT) || (XVar)(mode == Constants.MODE_INLINE_EDIT)) && (XVar)(MVCFunctions.strlen((XVar)(value))))
            {
                MVCFunctions.Echo("<br>");
            }
            MVCFunctions.Echo(MVCFunctions.Concat("<input type=\"File\" ", this.inputStyle, " id=\"", this.cfield, "\" ", (XVar.Pack((XVar)((XVar)(mode == Constants.MODE_INLINE_EDIT) || (XVar)(mode == Constants.MODE_INLINE_ADD)) && (XVar)(this.is508)) ? XVar.Pack(MVCFunctions.Concat("alt=\"", this.strLabel, "\" ")) : XVar.Pack("")), " name=\"", this.cfield, "\" >", strfilename));
            MVCFunctions.Echo(MVCFunctions.Concat("<input type=\"Hidden\" id=\"notempty_", this.cfieldname, "\" value=\"", (XVar.Pack(MVCFunctions.strlen((XVar)(value))) ? XVar.Pack(1) : XVar.Pack(0)), "\">"));
            buildControlEnd((XVar)(validate), (XVar)(mode));
            return(null);
        }
Exemple #19
0
        public ActionResult detailspreview()
        {
            try
            {
                dynamic         masterKeys = XVar.Array(), mastertable = null, mode = null, pageObject = null, query = null, recordsCounter = null, returnJSON = XVar.Array(), rowcount = null, sessionPrefix = null, var_params = XVar.Array(), whereClauses = XVar.Array();
                ProjectSettings pSet;
                XTempl          xt;
                dbo__ABCVotes_Variables.Apply();
                MVCFunctions.Header("Expires", "Thu, 01 Jan 1970 00:00:01 GMT");
                mode = XVar.Clone(MVCFunctions.postvalue(new XVar("mode")));
                if (XVar.Pack(!(XVar)(CommonFunctions.isLogged())))
                {
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                if (XVar.Pack(!(XVar)(CommonFunctions.CheckSecurity((XVar)(XSession.Session[MVCFunctions.Concat("_", GlobalVars.strTableName, "_OwnerID")]), new XVar("Search")))))
                {
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                GlobalVars.cipherer = XVar.Clone(new RunnerCipherer((XVar)(GlobalVars.strTableName)));
                xt = XVar.UnPackXTempl(new XTempl());
                {
                    TLayout t_layout = null;

                    t_layout                      = new TLayout(new XVar("detailspreview"), new XVar("AvenueAvenue"), new XVar("MobileAvenue"));
                    t_layout.version              = 2;
                    t_layout.blocks["bare"]       = XVar.Array();
                    t_layout.containers["dcount"] = XVar.Array();
                    t_layout.containers["dcount"].Add(new XVar("name", "detailspreviewheader", "block", "", "substyle", 1));

                    t_layout.containers["dcount"].Add(new XVar("name", "detailspreviewdetailsfount", "block", "", "substyle", 1));

                    t_layout.containers["dcount"].Add(new XVar("name", "detailspreviewdispfirst", "block", "display_first", "substyle", 1));

                    t_layout.skins["dcount"] = "empty";

                    t_layout.blocks["bare"].Add("dcount");
                    t_layout.containers["detailspreviewgrid"] = XVar.Array();
                    t_layout.containers["detailspreviewgrid"].Add(new XVar("name", "detailspreviewfields", "block", "details_data", "substyle", 1));

                    t_layout.skins["detailspreviewgrid"] = "grid";

                    t_layout.blocks["bare"].Add("detailspreviewgrid");
                    GlobalVars.page_layouts["dbo__ABCVotes_detailspreview"] = t_layout;

                    t_layout.skinsparams                        = XVar.Array();
                    t_layout.skinsparams["empty"]               = XVar.Array();
                    t_layout.skinsparams["empty"]["button"]     = "button2";
                    t_layout.skinsparams["menu"]                = XVar.Array();
                    t_layout.skinsparams["menu"]["button"]      = "button1";
                    t_layout.skinsparams["hmenu"]               = XVar.Array();
                    t_layout.skinsparams["hmenu"]["button"]     = "button1";
                    t_layout.skinsparams["undermenu"]           = XVar.Array();
                    t_layout.skinsparams["undermenu"]["button"] = "button1";
                    t_layout.skinsparams["fields"]              = XVar.Array();
                    t_layout.skinsparams["fields"]["button"]    = "button1";
                    t_layout.skinsparams["form"]                = XVar.Array();
                    t_layout.skinsparams["form"]["button"]      = "button1";
                    t_layout.skinsparams["1"]                   = XVar.Array();
                    t_layout.skinsparams["1"]["button"]         = "button1";
                    t_layout.skinsparams["2"]                   = XVar.Array();
                    t_layout.skinsparams["2"]["button"]         = "button1";
                    t_layout.skinsparams["3"]                   = XVar.Array();
                    t_layout.skinsparams["3"]["button"]         = "button1";
                }

                recordsCounter = new XVar(0);
                mastertable    = XVar.Clone(MVCFunctions.postvalue(new XVar("mastertable")));
                masterKeys     = XVar.Clone(MVCFunctions.my_json_decode((XVar)(MVCFunctions.postvalue(new XVar("masterKeys")))));
                sessionPrefix  = new XVar("_detailsPreview");
                if (mastertable != XVar.Pack(""))
                {
                    dynamic i = null;
                    XSession.Session[MVCFunctions.Concat(sessionPrefix, "_mastertable")] = mastertable;
                    i = new XVar(1);
                    if ((XVar)(MVCFunctions.is_array((XVar)(masterKeys))) && (XVar)(0 < MVCFunctions.count(masterKeys)))
                    {
                        while (XVar.Pack(masterKeys.KeyExists(MVCFunctions.Concat("masterkey", i))))
                        {
                            XSession.Session[MVCFunctions.Concat(sessionPrefix, "_masterkey", i)] = masterKeys[MVCFunctions.Concat("masterkey", i)];
                            i++;
                        }
                    }
                    if (XVar.Pack(XSession.Session.KeyExists(MVCFunctions.Concat(sessionPrefix, "_masterkey", i))))
                    {
                        XSession.Session.Remove(MVCFunctions.Concat(sessionPrefix, "_masterkey", i));
                    }
                }
                else
                {
                    mastertable = XVar.Clone(XSession.Session[MVCFunctions.Concat(sessionPrefix, "_mastertable")]);
                }
                var_params = XVar.Clone(XVar.Array());
                var_params.InitAndSetArrayItem(1, "id");
                var_params.InitAndSetArrayItem(xt, "xt");
                var_params.InitAndSetArrayItem(GlobalVars.strTableName, "tName");
                var_params.InitAndSetArrayItem("detailspreview", "pageType");
                GlobalVars.pageObject = XVar.Clone(new DetailsPreview((XVar)(var_params)));
                pSet         = XVar.UnPackProjectSettings(new ProjectSettings((XVar)(GlobalVars.strTableName), new XVar(Constants.PAGE_LIST)));
                whereClauses = XVar.Clone(XVar.Array());
                if (mastertable == "dbo._ABCReports")
                {
                    dynamic formattedValue = null;
                    formattedValue = XVar.Clone(CommonFunctions.make_db_value(new XVar("record"), (XVar)(XSession.Session[MVCFunctions.Concat(sessionPrefix, "_masterkey1")])));
                    if (formattedValue == "null")
                    {
                        whereClauses.InitAndSetArrayItem(MVCFunctions.Concat(GlobalVars.pageObject.getFieldSQLDecrypt(new XVar("record")), " is null"), null);
                    }
                    else
                    {
                        whereClauses.InitAndSetArrayItem(MVCFunctions.Concat(GlobalVars.pageObject.getFieldSQLDecrypt(new XVar("record")), "=", formattedValue), null);
                    }
                }
                if (mastertable == "ABC_Voting_Submitted")
                {
                    dynamic formattedValue = null;
                    formattedValue = XVar.Clone(CommonFunctions.make_db_value(new XVar("record"), (XVar)(XSession.Session[MVCFunctions.Concat(sessionPrefix, "_masterkey1")])));
                    if (formattedValue == "null")
                    {
                        whereClauses.InitAndSetArrayItem(MVCFunctions.Concat(GlobalVars.pageObject.getFieldSQLDecrypt(new XVar("record")), " is null"), null);
                    }
                    else
                    {
                        whereClauses.InitAndSetArrayItem(MVCFunctions.Concat(GlobalVars.pageObject.getFieldSQLDecrypt(new XVar("record")), "=", formattedValue), null);
                    }
                }
                if (mastertable == "ABC_Voting_Recirculated")
                {
                    dynamic formattedValue = null;
                    formattedValue = XVar.Clone(CommonFunctions.make_db_value(new XVar("record"), (XVar)(XSession.Session[MVCFunctions.Concat(sessionPrefix, "_masterkey1")])));
                    if (formattedValue == "null")
                    {
                        whereClauses.InitAndSetArrayItem(MVCFunctions.Concat(GlobalVars.pageObject.getFieldSQLDecrypt(new XVar("record")), " is null"), null);
                    }
                    else
                    {
                        whereClauses.InitAndSetArrayItem(MVCFunctions.Concat(GlobalVars.pageObject.getFieldSQLDecrypt(new XVar("record")), "=", formattedValue), null);
                    }
                }
                if (mastertable == "ABC_Voting_My_Voting")
                {
                    dynamic formattedValue = null;
                    formattedValue = XVar.Clone(CommonFunctions.make_db_value(new XVar("record"), (XVar)(XSession.Session[MVCFunctions.Concat(sessionPrefix, "_masterkey1")])));
                    if (formattedValue == "null")
                    {
                        whereClauses.InitAndSetArrayItem(MVCFunctions.Concat(GlobalVars.pageObject.getFieldSQLDecrypt(new XVar("record")), " is null"), null);
                    }
                    else
                    {
                        whereClauses.InitAndSetArrayItem(MVCFunctions.Concat(GlobalVars.pageObject.getFieldSQLDecrypt(new XVar("record")), "=", formattedValue), null);
                    }
                }
                if (mastertable == "dbo.vwABCReportsVoteCount")
                {
                    dynamic formattedValue = null;
                    formattedValue = XVar.Clone(CommonFunctions.make_db_value(new XVar("record"), (XVar)(XSession.Session[MVCFunctions.Concat(sessionPrefix, "_masterkey1")])));
                    if (formattedValue == "null")
                    {
                        whereClauses.InitAndSetArrayItem(MVCFunctions.Concat(GlobalVars.pageObject.getFieldSQLDecrypt(new XVar("record")), " is null"), null);
                    }
                    else
                    {
                        whereClauses.InitAndSetArrayItem(MVCFunctions.Concat(GlobalVars.pageObject.getFieldSQLDecrypt(new XVar("record")), "=", formattedValue), null);
                    }
                }
                whereClauses.InitAndSetArrayItem(CommonFunctions.SecuritySQL(new XVar("Search"), (XVar)(GlobalVars.strTableName)), null);
                query             = XVar.Clone(pSet.getSQLQuery());
                GlobalVars.strSQL = XVar.Clone(query.buildSQL_default((XVar)(whereClauses)));
                rowcount          = XVar.Clone(GlobalVars.pageObject.connection.getFetchedRowsNumber((XVar)(GlobalVars.strSQL)));
                GlobalVars.strSQL = MVCFunctions.Concat(GlobalVars.strSQL, GlobalVars.pageObject.getOrderByClause());
                xt.assign(new XVar("row_count"), (XVar)(rowcount));
                if (XVar.Pack(rowcount))
                {
                    dynamic b = null, data = XVar.Array(), display_count = null, format = null, keylink = null, qResult = null, row = XVar.Array(), rowinfo = XVar.Array(), rowinfo2 = XVar.Array(), value = null, var_class = null, viewContainer = null;
                    xt.assign(new XVar("details_data"), new XVar(true));

                    display_count = new XVar(10);
                    if (mode == "inline")
                    {
                        display_count *= 2;
                    }
                    if (display_count + 2 < rowcount)
                    {
                        xt.assign(new XVar("display_first"), new XVar(true));
                        xt.assign(new XVar("display_count"), (XVar)(display_count));
                    }
                    else
                    {
                        display_count = XVar.Clone(rowcount);
                    }
                    rowinfo       = XVar.Clone(XVar.Array());
                    viewContainer = XVar.Clone(new ViewControlsContainer((XVar)(pSet), new XVar(Constants.PAGE_LIST)));
                    viewContainer.isDetailsPreview = new XVar(true);
                    b       = new XVar(true);
                    qResult = XVar.Clone(GlobalVars.pageObject.connection.query((XVar)(GlobalVars.strSQL)));
                    data    = XVar.Clone(GlobalVars.cipherer.DecryptFetchedArray((XVar)(qResult.fetchAssoc())));
                    while ((XVar)(data) && (XVar)(recordsCounter < display_count))
                    {
                        recordsCounter++;
                        row     = XVar.Clone(XVar.Array());
                        keylink = new XVar("");
                        keylink = MVCFunctions.Concat(keylink, "&key1=", MVCFunctions.runner_htmlspecialchars((XVar)(MVCFunctions.RawUrlEncode((XVar)(data["id"])))));
                        keylink = MVCFunctions.Concat(keylink, "&key2=", MVCFunctions.runner_htmlspecialchars((XVar)(MVCFunctions.RawUrlEncode((XVar)(data["record"])))));

                        viewContainer.recId = XVar.Clone(recordsCounter);
                        value = XVar.Clone(viewContainer.showDBValue(new XVar("committee_member"), (XVar)(data), (XVar)(keylink)));
                        row.InitAndSetArrayItem(value, "committee_member_value");
                        format    = XVar.Clone(pSet.getViewFormat(new XVar("committee_member")));
                        var_class = new XVar("rnr-field-text");
                        if (format == Constants.FORMAT_FILE)
                        {
                            var_class = new XVar(" rnr-field-file");
                        }
                        if (format == Constants.FORMAT_AUDIO)
                        {
                            var_class = new XVar(" rnr-field-audio");
                        }
                        if (format == Constants.FORMAT_CHECKBOX)
                        {
                            var_class = new XVar(" rnr-field-checkbox");
                        }
                        if ((XVar)(format == Constants.FORMAT_NUMBER) || (XVar)(CommonFunctions.IsNumberType((XVar)(pSet.getFieldType(new XVar("committee_member"))))))
                        {
                            var_class = new XVar(" rnr-field-number");
                        }
                        row.InitAndSetArrayItem(var_class, "committee_member_class");
                        viewContainer.recId = XVar.Clone(recordsCounter);
                        value = XVar.Clone(viewContainer.showDBValue(new XVar("date_voted"), (XVar)(data), (XVar)(keylink)));
                        row.InitAndSetArrayItem(value, "date_voted_value");
                        format    = XVar.Clone(pSet.getViewFormat(new XVar("date_voted")));
                        var_class = new XVar("rnr-field-text");
                        if (format == Constants.FORMAT_FILE)
                        {
                            var_class = new XVar(" rnr-field-file");
                        }
                        if (format == Constants.FORMAT_AUDIO)
                        {
                            var_class = new XVar(" rnr-field-audio");
                        }
                        if (format == Constants.FORMAT_CHECKBOX)
                        {
                            var_class = new XVar(" rnr-field-checkbox");
                        }
                        if ((XVar)(format == Constants.FORMAT_NUMBER) || (XVar)(CommonFunctions.IsNumberType((XVar)(pSet.getFieldType(new XVar("date_voted"))))))
                        {
                            var_class = new XVar(" rnr-field-number");
                        }
                        row.InitAndSetArrayItem(var_class, "date_voted_class");
                        viewContainer.recId = XVar.Clone(recordsCounter);
                        value = XVar.Clone(viewContainer.showDBValue(new XVar("vote"), (XVar)(data), (XVar)(keylink)));
                        row.InitAndSetArrayItem(value, "vote_value");
                        format    = XVar.Clone(pSet.getViewFormat(new XVar("vote")));
                        var_class = new XVar("rnr-field-text");
                        if (format == Constants.FORMAT_FILE)
                        {
                            var_class = new XVar(" rnr-field-file");
                        }
                        if (format == Constants.FORMAT_AUDIO)
                        {
                            var_class = new XVar(" rnr-field-audio");
                        }
                        if (format == Constants.FORMAT_CHECKBOX)
                        {
                            var_class = new XVar(" rnr-field-checkbox");
                        }
                        if ((XVar)(format == Constants.FORMAT_NUMBER) || (XVar)(CommonFunctions.IsNumberType((XVar)(pSet.getFieldType(new XVar("vote"))))))
                        {
                            var_class = new XVar(" rnr-field-number");
                        }
                        row.InitAndSetArrayItem(var_class, "vote_class");
                        viewContainer.recId = XVar.Clone(recordsCounter);
                        value = XVar.Clone(viewContainer.showDBValue(new XVar("comment"), (XVar)(data), (XVar)(keylink)));
                        row.InitAndSetArrayItem(value, "comment_value");
                        format    = XVar.Clone(pSet.getViewFormat(new XVar("comment")));
                        var_class = new XVar("rnr-field-text");
                        if (format == Constants.FORMAT_FILE)
                        {
                            var_class = new XVar(" rnr-field-file");
                        }
                        if (format == Constants.FORMAT_AUDIO)
                        {
                            var_class = new XVar(" rnr-field-audio");
                        }
                        if (format == Constants.FORMAT_CHECKBOX)
                        {
                            var_class = new XVar(" rnr-field-checkbox");
                        }
                        if ((XVar)(format == Constants.FORMAT_NUMBER) || (XVar)(CommonFunctions.IsNumberType((XVar)(pSet.getFieldType(new XVar("comment"))))))
                        {
                            var_class = new XVar(" rnr-field-number");
                        }
                        row.InitAndSetArrayItem(var_class, "comment_class");
                        rowinfo.InitAndSetArrayItem(row, null);
                        if (XVar.Pack(b))
                        {
                            rowinfo2.InitAndSetArrayItem(row, null);
                            b = new XVar(false);
                        }
                        data = XVar.Clone(GlobalVars.cipherer.DecryptFetchedArray((XVar)(qResult.fetchAssoc())));
                    }
                    xt.assign_loopsection(new XVar("details_row"), (XVar)(rowinfo));
                    xt.assign_loopsection(new XVar("details_row_header"), (XVar)(rowinfo2));
                }
                returnJSON = XVar.Clone(new XVar("success", true));
                xt.load_template((XVar)(MVCFunctions.GetTemplateName(new XVar("dbo__ABCVotes"), new XVar("detailspreview"))));
                returnJSON.InitAndSetArrayItem(xt.fetch_loaded(), "body");
                if (mode != "inline")
                {
                    dynamic layout = null;
                    returnJSON.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("counter")), "counter");
                    layout = XVar.Clone(CommonFunctions.GetPageLayout((XVar)(MVCFunctions.GoodFieldName((XVar)(GlobalVars.strTableName))), new XVar("detailspreview")));
                    if (XVar.Pack(layout))
                    {
                        foreach (KeyValuePair <XVar, dynamic> css in layout.getCSSFiles((XVar)(CommonFunctions.isRTL()), (XVar)((XVar)(CommonFunctions.mobileDeviceDetected()) && (XVar)(layout.version != Constants.BOOTSTRAP_LAYOUT))).GetEnumerator())
                        {
                            returnJSON.InitAndSetArrayItem(css.Value, "CSSFiles", null);
                        }
                    }
                }
                MVCFunctions.Echo(CommonFunctions.printJSON((XVar)(returnJSON)));
                MVCFunctions.Echo(new XVar(""));
                return(MVCFunctions.GetBuferContentAndClearBufer());
            }
            catch (RunnerRedirectException ex)
            { return(Redirect(ex.Message)); }
        }
Exemple #20
0
        public virtual XVar set_file_delete_url(dynamic _param_file)
        {
            #region pass-by-value parameters
            dynamic file = XVar.Clone(_param_file);
            #endregion

            file.InitAndSetArrayItem(MVCFunctions.Concat(this.options["script_url"], "?file=", MVCFunctions.RawUrlEncode((XVar)(file["name"]))), "delete_url");
            file.InitAndSetArrayItem(this.options["delete_type"], "delete_type");
            if (!XVar.Equals(XVar.Pack(file["delete_type"]), XVar.Pack("DELETE")))
            {
                file["delete_url"] = MVCFunctions.Concat(file["delete_url"], "&_method=DELETE");
            }
            return(null);
        }
Exemple #21
0
        public virtual XVar handle_file_upload(dynamic _param_uploadedFile, dynamic _param_index)
        {
            #region pass-by-value parameters
            dynamic uploadedFile = XVar.Clone(_param_uploadedFile);
            dynamic index        = XVar.Clone(_param_index);
            #endregion

            dynamic file = XVar.Array(), fileInfo = null, name = null, path_parts = XVar.Array(), size = null, tmpName = null, uploadDir = null, uploadDirRelative = null, var_error = null, var_type = null;
            tmpName           = XVar.Clone(uploadedFile["tmp_name"]);
            name              = XVar.Clone(uploadedFile["name"]);
            size              = XVar.Clone(uploadedFile["size"]);
            var_type          = XVar.Clone(uploadedFile["type"]);
            var_error         = XVar.Clone(uploadedFile["error"]);
            fileInfo          = XVar.Clone(new XVar("name", name, "size", MVCFunctions.intval((XVar)(size)), "type", var_type, "isThumbnail", false));
            uploadDir         = XVar.Clone(this.pSet.getFinalUploadFolder((XVar)(this.field), (XVar)(fileInfo)));
            uploadDirRelative = XVar.Clone(this.pSet.getUploadFolder((XVar)(this.field), (XVar)(fileInfo)));
            file              = XVar.Clone(XVar.Array());
            file.InitAndSetArrayItem(false, "error");
            file.InitAndSetArrayItem(MVCFunctions.trim_file_name((XVar)(name), (XVar)(var_type), (XVar)(index), this), "name");
            file.InitAndSetArrayItem(file["name"], "usrName");
            file.InitAndSetArrayItem(MVCFunctions.intval((XVar)(size)), "size");
            switch (((XVar)var_type).ToString())
            {
            case "image/png":
            case "image/x-png":
                file.InitAndSetArrayItem("image/png", "type");
                break;

            case "image/jpeg":
            case "image/pjpeg":
                file.InitAndSetArrayItem("image/jpeg", "type");
                break;

            default:
                file.InitAndSetArrayItem(var_type, "type");
                break;
            }
            path_parts = XVar.Clone(pathinfo_local((XVar)(name)));
            if (file["type"] == "")
            {
                file.InitAndSetArrayItem(CommonFunctions.getContentTypeByExtension((XVar)(path_parts["extension"])), "type");
            }
            file.InitAndSetArrayItem(false, "isImg");
            file.InitAndSetArrayItem("", "thumbnail");
            if (XVar.Pack(this.pSet.isMakeDirectoryNeeded((XVar)(this.field))))
            {
                if (XVar.Pack(!(XVar)(MVCFunctions.makeSurePathExists((XVar)(uploadDir)))))
                {
                    file.InitAndSetArrayItem("No existe el envío de carpetas", "error");
                    return(file);
                }
            }
            else
            {
                if (XVar.Pack(!(XVar)(MVCFunctions.is_dir((XVar)(uploadDir)))))
                {
                    file.InitAndSetArrayItem("No existe el envío de carpetas", "error");
                    return(file);
                }
            }
            if (XVar.Pack(validate((XVar)(uploadedFile), (XVar)(file), (XVar)(var_error), (XVar)(size), (XVar)(index), (XVar)(uploadDir))))
            {
                dynamic file_path = null, file_size = null;
                file.InitAndSetArrayItem(CommonFunctions.CheckImageExtension((XVar)(tmpName)) != false, "isImg");
                handle_form_data((XVar)(file), (XVar)(index));
                file.InitAndSetArrayItem(tempnam_sfx((XVar)(uploadDir), (XVar)(path_parts["filename"]), (XVar)(path_parts["extension"])), "name");
                file_path = XVar.Clone(MVCFunctions.Concat(uploadDir, file["name"]));
                MVCFunctions.clearstatcache();
                MVCFunctions.upload_File((XVar)(uploadedFile), (XVar)(file_path));
                file_size = XVar.Clone(MVCFunctions.filesize((XVar)(file_path)));
                if (XVar.Pack(this.options["resizeOnUpload"]))
                {
                    dynamic new_file_name = null, tempOptions = null;
                    tempOptions   = XVar.Clone(new XVar("max_width", this.options["max_width"], "max_height", this.options["max_width"]));
                    new_file_name = XVar.Clone(tempnam_sfx((XVar)(uploadDir), (XVar)(path_parts["filename"]), (XVar)(path_parts["extension"])));
                    if (XVar.Pack(create_scaled_image((XVar)(MVCFunctions.Concat(uploadDir, file["name"])), (XVar)(uploadDir), (XVar)(new_file_name), (XVar)(tempOptions), (XVar)(file), new XVar(false), (XVar)(uploadDirRelative), (XVar)(uploadedFile))))
                    {
                        MVCFunctions.unlink((XVar)(file_path));
                        file.InitAndSetArrayItem(new_file_name, "name");
                        file_path = XVar.Clone(MVCFunctions.Concat(uploadDir, new_file_name));
                        file_size = XVar.Clone(MVCFunctions.filesize((XVar)(file_path)));
                    }
                }
                if (XVar.Equals(XVar.Pack(file_size), XVar.Pack(file["size"])))
                {
                    file.InitAndSetArrayItem(MVCFunctions.Concat(uploadDir, MVCFunctions.RawUrlEncode((XVar)(file["name"]))), "url");
                    foreach (KeyValuePair <XVar, dynamic> options in this.options["image_versions"].GetEnumerator())
                    {
                        dynamic fileInfoThimbnail = null, thumbUploadDir = null, thumbUploadDirRelative = null, thumbnail_name = null;
                        fileInfoThimbnail      = XVar.Clone(new XVar("name", name, "size", MVCFunctions.intval((XVar)(size)), "type", var_type, "isThumbnail", true));
                        thumbUploadDir         = XVar.Clone(this.pSet.getFinalUploadFolder((XVar)(this.field), (XVar)(fileInfoThimbnail)));
                        thumbUploadDirRelative = XVar.Clone(this.pSet.getUploadFolder((XVar)(this.field), (XVar)(fileInfoThimbnail)));
                        if (XVar.Pack(this.pSet.isMakeDirectoryNeeded((XVar)(this.field))))
                        {
                            if (XVar.Pack(!(XVar)(MVCFunctions.makeSurePathExists((XVar)(thumbUploadDir)))))
                            {
                                continue;
                            }
                        }
                        thumbnail_name = XVar.Clone(tempnam_sfx((XVar)(thumbUploadDir), (XVar)(MVCFunctions.Concat(options.Value["thumbnailPrefix"], path_parts["filename"])), (XVar)(path_parts["extension"])));
                        if (XVar.Pack(create_scaled_image((XVar)(MVCFunctions.Concat(uploadDir, file["name"])), (XVar)(thumbUploadDir), (XVar)(thumbnail_name), (XVar)(options.Value), (XVar)(file), new XVar(true), (XVar)(thumbUploadDirRelative), (XVar)(uploadedFile))))
                        {
                            MVCFunctions.clearstatcache();
                            file_size = XVar.Clone(MVCFunctions.filesize((XVar)(file_path)));
                        }
                    }
                }
                else
                {
                    MVCFunctions.unlink((XVar)(file_path));
                    file.InitAndSetArrayItem("abort", "error");
                }
                file.InitAndSetArrayItem(file_size, "size");
                file.InitAndSetArrayItem(MVCFunctions.Concat(uploadDirRelative, file["name"]), "name");
                set_file_delete_url((XVar)(file));
            }
            return(file);
        }
Exemple #22
0
        public PrintPage(dynamic var_params = null)
            : base((XVar)var_params)
        {
            if (skipPrintPageCtor)
            {
                skipPrintPageCtor = false;
                return;
            }
            #region default values
            if (var_params as Object == null)
            {
                var_params = new XVar("");
            }
            #endregion

            dynamic i = null;
            if (XVar.Pack(this.selection))
            {
                this.allPagesMode = new XVar(true);
            }
            if (XVar.Pack(!(XVar)(this.detailTables)))
            {
                this.detailTables = XVar.Clone(XVar.Array());
            }
            if (XVar.Pack(!(XVar)(MVCFunctions.is_array((XVar)(this.detailTables)))))
            {
                this.detailTables = XVar.Clone(new XVar(0, this.detailTables));
            }
            if (XVar.Pack(!(XVar)(this.pdfMode)))
            {
                this.controlsMap.InitAndSetArrayItem(XVar.Array(), "pdfSettings");
                this.controlsMap.InitAndSetArrayItem(MVCFunctions.RawUrlEncode((XVar)(MVCFunctions.my_json_encode((XVar)(this.selection)))), "pdfSettings", "selectedJSON");
                this.controlsMap.InitAndSetArrayItem(MVCFunctions.RawUrlEncode((XVar)(MVCFunctions.my_json_encode((XVar)(this.detailTables)))), "pdfSettings", "detailTablesJSON");
                this.controlsMap.InitAndSetArrayItem(this.allPagesMode, "pdfSettings", "allPagesMode");
            }
            else
            {
                this.allPagesMode = XVar.Clone(MVCFunctions.postvalue(new XVar("allPagesMode")));
                this.selection    = XVar.Clone(MVCFunctions.my_json_decode((XVar)(MVCFunctions.RawUrlDecode((XVar)(MVCFunctions.postvalue(new XVar("selectedJSON")))))));
                if (XVar.Pack(!(XVar)(this.selection)))
                {
                    this.selection = XVar.Clone(XVar.Array());
                }
                this.detailTables = XVar.Clone(MVCFunctions.my_json_decode((XVar)(MVCFunctions.RawUrlDecode((XVar)(MVCFunctions.postvalue(new XVar("detailTablesJSON")))))));
            }
            this.printGridLayout = XVar.Clone(this.pSet.getPrintGridLayout());
            this.recsPerRowPrint = XVar.Clone(this.pSet.getRecordsPerRowPrint());
            i = new XVar(0);
            for (; i < MVCFunctions.count(this.detailKeysByM); i++)
            {
                this.masterKeys.InitAndSetArrayItem(XSession.Session[MVCFunctions.Concat(this.sessionPrefix, "_masterkey", i + 1)], null);
            }
            this.masterTable  = XVar.Clone(XSession.Session[MVCFunctions.Concat(this.sessionPrefix, "_mastertable")]);
            this.totalsFields = XVar.Clone(this.pSet.getTotalsFields());
            if (XVar.Pack(!(XVar)(this.splitByRecords)))
            {
                this.splitByRecords = XVar.Clone(this.pSet.getPrinterSplitRecords());
            }
            if (XVar.Pack(this.pdfMode))
            {
                this.splitByRecords = XVar.Clone(this.pSet.getPrinterPDFSplitRecords());
            }
            if (XVar.Pack(this.pSet.isAllowShowHideFields()))
            {
                dynamic hideColumns = XVar.Array();
                hideColumns      = XVar.Clone(getColumnsToHide());
                this.hideColumns = XVar.Clone(hideColumns[Constants.DESKTOP]);
                if (XVar.Pack(!(XVar)(MVCFunctions.is_array((XVar)(this.hideColumns)))))
                {
                    this.hideColumns = XVar.Clone(XVar.Array());
                }
            }
        }
Exemple #23
0
        protected virtual XVar buildGridRecord(dynamic _param_data, dynamic row)
        {
            #region pass-by-value parameters
            dynamic data = XVar.Clone(_param_data);
            #endregion

            dynamic i = null, keyFields = XVar.Array(), keylink = null, printFields = XVar.Array(), record = XVar.Array();
            genId();
            record = XVar.Clone(XVar.Array());
            record.InitAndSetArrayItem(MVCFunctions.Concat("data-record-id=\"", this.recId, "\""), "recordattrs");
            countTotals((XVar)(this.totals), (XVar)(data));
            keyFields = XVar.Clone(this.pSet.getTableKeys());
            keylink   = new XVar("");
            i         = new XVar(0);
            for (; i < MVCFunctions.count(keyFields); i++)
            {
                keylink = MVCFunctions.Concat(keylink, "&key", i + 1, "=", MVCFunctions.runner_htmlspecialchars((XVar)(MVCFunctions.RawUrlEncode((XVar)(data[keyFields[i]])))));
            }
            if (XVar.Pack(this.eventsObject.exists(new XVar("BeforeMoveNextPrint"))))
            {
                this.eventsObject.BeforeMoveNextPrint((XVar)(data), (XVar)(row), (XVar)(record), this);
            }
            printFields = this.pSet.getPrinterFields();
            i           = new XVar(0);
            for (; i < MVCFunctions.count(printFields); i++)
            {
                record.InitAndSetArrayItem(showDBValue((XVar)(printFields[i]), (XVar)(data), (XVar)(keylink)), MVCFunctions.Concat(MVCFunctions.GoodFieldName((XVar)(printFields[i])), "_value"));
                setRowClassNames((XVar)(record), (XVar)(printFields[i]));
            }
            spreadRowStyles((XVar)(data), (XVar)(row), (XVar)(record));
            setRowCssRules((XVar)(record));
            record.InitAndSetArrayItem(true, "grid_recordheader");
            record.InitAndSetArrayItem(true, "grid_vrecord");
            return(record);
        }
Exemple #24
0
        public virtual XVar ConfirmLock(dynamic _param_strtable, dynamic _param_keys, ref dynamic message)
        {
            #region pass-by-value parameters
            dynamic strtable = XVar.Clone(_param_strtable);
            dynamic keys     = XVar.Clone(_param_keys);
            #endregion

            dynamic data = XVar.Array(), myfound = null, newdate = null, newid = null, olddate = null, oldid = null, otherfound = null, qResult = null, sdate = null, skeys = null, tempfound = null, where = null;
            skeys = new XVar("");
            foreach (KeyValuePair <XVar, dynamic> val in keys.GetEnumerator())
            {
                if (XVar.Pack(MVCFunctions.strlen((XVar)(skeys))))
                {
                    skeys = MVCFunctions.Concat(skeys, "&");
                }
                skeys = MVCFunctions.Concat(skeys, MVCFunctions.RawUrlEncode((XVar)(val.Value)));
            }
            sdate = XVar.Clone(MVCFunctions.now());
            insert((XVar)(strtable), (XVar)(sdate), (XVar)(sdate), (XVar)(skeys), (XVar)(MVCFunctions.session_id()), (XVar)(this.UserID), new XVar(1));
            where      = XVar.Clone(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("table")), "=", this.connection.prepareString((XVar)(strtable)), " AND ", this.connection.addFieldWrappers(new XVar("keys")), "=", this.connection.prepareString((XVar)(skeys)), " AND ", this.connection.addFieldWrappers(new XVar("action")), "=1"));
            qResult    = XVar.Clone(query((XVar)(where), (XVar)(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("id")), " asc"))));
            myfound    = new XVar(0);
            newid      = new XVar(0);
            oldid      = new XVar(0);
            newdate    = new XVar("");
            olddate    = new XVar("");
            otherfound = new XVar(0);
            tempfound  = new XVar(0);
            while (XVar.Pack(data = XVar.Clone(qResult.fetchAssoc())))
            {
                if (data["sessionid"] == MVCFunctions.session_id())
                {
                    oldid   = XVar.Clone(newid);
                    newid   = XVar.Clone(data["id"]);
                    newdate = XVar.Clone(data["confirmdatetime"]);
                    olddate = XVar.Clone(newdate);
                    myfound++;
                    otherfound = XVar.Clone(tempfound);
                    tempfound  = new XVar(0);
                    continue;
                }
                tempfound++;
            }
            if ((XVar)(1 < myfound) && (XVar)(!(XVar)(otherfound)))
            {
                update((XVar)(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("confirmdatetime")), "=", this.connection.addDateQuotes((XVar)(MVCFunctions.now())))), (XVar)(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("id")), "=", oldid)));
                delete((XVar)(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("id")), "=", newid)));
                return(true);
            }
            else
            {
                if ((XVar)(1 < myfound) && (XVar)(otherfound))
                {
                    if (this.UnlockTime - 5 < MVCFunctions.secondsPassedFrom((XVar)(olddate)))
                    {
                        UnlockRecord((XVar)(strtable), (XVar)(keys), (XVar)(MVCFunctions.session_id()));
                        message = XVar.Clone(this.ConfirmUser);
                        return(false);
                    }
                    else
                    {
                        update((XVar)(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("confirmdatetime")), "=", this.connection.addDateQuotes((XVar)(MVCFunctions.now())))), (XVar)(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("id")), "=", oldid)));
                        delete((XVar)(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("id")), "=", newid)));
                        return(true);
                    }
                }
                else
                {
                    UnlockRecord((XVar)(strtable), (XVar)(keys), (XVar)(MVCFunctions.session_id()));
                    where = XVar.Clone(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("table")), "=", this.connection.prepareString((XVar)(strtable)), " AND ", this.connection.addFieldWrappers(new XVar("keys")), "=", this.connection.prepareString((XVar)(skeys)), " AND ", this.connection.addFieldWrappers(new XVar("sessionid")), "<>'", MVCFunctions.session_id(), "' AND ", this.connection.addFieldWrappers(new XVar("action")), "=2"));
                    if (XVar.Pack(data = XVar.Clone(query((XVar)(where), (XVar)(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("id")), " asc"))).fetchAssoc())))
                    {
                        message = XVar.Clone(MVCFunctions.mysprintf((XVar)(this.ConfirmAdmin), (XVar)(new XVar(0, data["userid"]))));
                    }
                    else
                    {
                        message = XVar.Clone(this.ConfirmUser);
                    }
                    where = XVar.Clone(MVCFunctions.Concat(this.connection.addFieldWrappers(new XVar("action")), "=2 AND ", this.connection.addFieldWrappers(new XVar("table")), "=", this.connection.prepareString((XVar)(strtable)), " AND ", this.connection.addFieldWrappers(new XVar("keys")), "=", this.connection.prepareString((XVar)(skeys))));
                    delete((XVar)(where));
                    return(false);
                }
            }
            return(null);
        }
Exemple #25
0
        public virtual XVar buildUserFile(dynamic _param_file)
        {
            #region pass-by-value parameters
            dynamic file = XVar.Clone(_param_file);
            #endregion

            dynamic hasThumbnail = null, userFile = XVar.Array();
            userFile = XVar.Clone(XVar.Array());
            userFile.InitAndSetArrayItem(file["usrName"], "name");
            userFile.InitAndSetArrayItem(file["size"], "size");
            userFile.InitAndSetArrayItem(file["type"], "type");
            userFile.InitAndSetArrayItem(CommonFunctions.CheckImageExtension((XVar)(file["name"])) != false, "isImg");
            if (XVar.Pack(file["error"]))
            {
                userFile.InitAndSetArrayItem(file["error"], "error");
            }
            hasThumbnail = XVar.Clone(file["thumbnail"] != "");
            userFile.InitAndSetArrayItem(MVCFunctions.GetTableLink(new XVar("mfhandler"), new XVar(""), (XVar)(MVCFunctions.Concat("file=", MVCFunctions.RawUrlEncode((XVar)(userFile["name"])), "&table=", MVCFunctions.RawUrlEncode((XVar)(this.table)), "&field=", MVCFunctions.RawUrlEncode((XVar)(this.field)), "&pageType=", MVCFunctions.RawUrlEncode((XVar)(this.pageType)), (XVar.Pack(this.tkeys != "") ? XVar.Pack(this.tkeys) : XVar.Pack(MVCFunctions.Concat("&fkey=", this.formStamp)))))), "url");
            if (XVar.Pack(hasThumbnail))
            {
                userFile.InitAndSetArrayItem(MVCFunctions.Concat(userFile["url"], "&thumbnail=1"), "thumbnail_url");
            }
            else
            {
                userFile.InitAndSetArrayItem("", "thumbnail_url");
            }
            return(userFile);
        }
Exemple #26
0
        public virtual XVar preparePage()
        {
            dynamic fields = XVar.Array(), i = null, keylink = null, tKeys = XVar.Array();

            if ((XVar)(!(XVar)(this.masterRecordData)) || (XVar)(!(XVar)(MVCFunctions.count(this.masterRecordData))))
            {
                return(null);
            }
            this.xt.assign(new XVar("pagetitlelabel"), (XVar)(getPageTitle((XVar)(this.pageType), (XVar)(MVCFunctions.GoodFieldName((XVar)(this.tName))), (XVar)(this.masterRecordData))));
            tKeys   = XVar.Clone(this.pSet.getTableKeys());
            keylink = new XVar("");
            i       = new XVar(0);
            for (; i < MVCFunctions.count(tKeys); i++)
            {
                keylink = MVCFunctions.Concat(keylink, "&key", i + 1, "=", MVCFunctions.runner_htmlspecialchars((XVar)(MVCFunctions.RawUrlEncode((XVar)(this.masterRecordData[tKeys[i]])))));
            }
            fields = XVar.Clone(this.pSet.getPageFields());
            fields = XVar.Clone(MVCFunctions.array_merge((XVar)(fields), (XVar)(tKeys)));
            foreach (KeyValuePair <XVar, dynamic> f in fields.GetEnumerator())
            {
                dynamic fieldClassStr = null, value = null;
                fieldClassStr = XVar.Clone(fieldClass((XVar)(f.Value)));
                this.xt.assign((XVar)(MVCFunctions.Concat(MVCFunctions.GoodFieldName((XVar)(f.Value)), "_fieldheader")), new XVar(true));
                value = XVar.Clone(showDBValue((XVar)(f.Value), (XVar)(this.masterRecordData), (XVar)(keylink)));
                if (XVar.Pack(pdfJsonMode()))
                {
                    this.xt.assign((XVar)(MVCFunctions.Concat(MVCFunctions.GoodFieldName((XVar)(f.Value)), "_pdfvalue")), (XVar)(value));
                }
                else
                {
                    dynamic wrappedValue = null;
                    wrappedValue = XVar.Clone(MVCFunctions.Concat("<span class='", fieldClassStr, "'>", value, "</span>"));
                    this.xt.assign((XVar)(MVCFunctions.Concat(MVCFunctions.GoodFieldName((XVar)(f.Value)), "_mastervalue")), (XVar)(wrappedValue));
                    this.xt.assign((XVar)(MVCFunctions.Concat(MVCFunctions.GoodFieldName((XVar)(f.Value)), "_value")), (XVar)(wrappedValue));
                }
                this.xt.assign((XVar)(MVCFunctions.Concat(MVCFunctions.GoodFieldName((XVar)(f.Value)), "_class")), (XVar)(fieldClassStr));
                this.xt.assign((XVar)(MVCFunctions.Concat(MVCFunctions.GoodFieldName((XVar)(f.Value)), "_fieldcolumn")), new XVar(true));
                this.xt.assign((XVar)(MVCFunctions.Concat(MVCFunctions.GoodFieldName((XVar)(f.Value)), "_fieldheadercolumn")), new XVar(true));
            }
            this.xt.assign(new XVar("grid_header"), new XVar(true));
            this.xt.assign(new XVar("grid_row"), new XVar(true));
            this.xt.assign(new XVar("grid_record"), new XVar(true));
            this.xt.assign(new XVar("grid_vrecord"), new XVar(true));
            if (XVar.Pack(this.pageLayout))
            {
                this.xt.assign(new XVar("pageattrs"), (XVar)(MVCFunctions.Concat("class=\"", this.pageLayout.style, " page-", this.pageLayout.name, "\"")));
            }
            if (XVar.Pack(!(XVar)(pdfJsonMode())))
            {
                this.xt.load_template((XVar)(MVCFunctions.GetTemplateName((XVar)(this.shortTableName), (XVar)(MVCFunctions.Concat("master", this.masterPageType)))));
            }
            return(null);
        }
Exemple #27
0
        protected virtual XVar prepareFields()
        {
            dynamic data = XVar.Array(), keyParams = XVar.Array(), keylink = null, viewFields = XVar.Array();

            viewFields = XVar.Clone(this.pSet.getViewFields());
            data       = XVar.Clone(getCurrentRecordInternal());
            foreach (KeyValuePair <XVar, dynamic> kf in this.pSet.getTableKeys().GetEnumerator())
            {
                keyParams.InitAndSetArrayItem(MVCFunctions.Concat("&key", kf.Key + 1, "=", MVCFunctions.runner_htmlspecialchars((XVar)(MVCFunctions.RawUrlEncode((XVar)(data[kf.Value]))))), null);
            }
            keylink = XVar.Clone(MVCFunctions.implode(new XVar(""), (XVar)(keyParams)));
            foreach (KeyValuePair <XVar, dynamic> f in viewFields.GetEnumerator())
            {
                dynamic gname = null, value = null;
                gname = XVar.Clone(MVCFunctions.GoodFieldName((XVar)(f.Value)));
                value = XVar.Clone(MVCFunctions.Concat("<span id=\"view", this.id, "_", gname, "\" >", showDBValue((XVar)(f.Value), (XVar)(data), (XVar)(keylink)), "</span>"));
                this.xt.assign((XVar)(MVCFunctions.Concat(gname, "_value")), (XVar)(value));
                if (XVar.Pack(!(XVar)(isAppearOnTabs((XVar)(f.Value)))))
                {
                    this.xt.assign((XVar)(MVCFunctions.Concat(gname, "_fieldblock")), new XVar(true));
                }
                else
                {
                    this.xt.assign((XVar)(MVCFunctions.Concat(gname, "_tabfieldblock")), new XVar(true));
                }
                if ((XVar)(this.pSet.hideEmptyViewFields()) && (XVar)(data[f.Value] == ""))
                {
                    hideField((XVar)(f.Value));
                }
            }
            return(null);
        }
Exemple #28
0
        protected override XVar getShorteningTextAndMoreLink(dynamic _param_value, dynamic _param_cNumberOfChars, dynamic _param_keylink, dynamic _param_isLookup)
        {
            #region pass-by-value parameters
            dynamic value          = XVar.Clone(_param_value);
            dynamic cNumberOfChars = XVar.Clone(_param_cNumberOfChars);
            dynamic keylink        = XVar.Clone(_param_keylink);
            dynamic isLookup       = XVar.Clone(_param_isLookup);
            #endregion

            dynamic data = XVar.Array(), isTruncated = null, processedValue = null;
            data           = XVar.Clone(getPocessedHTMLValueData((XVar)(value), (XVar)(cNumberOfChars)));
            isTruncated    = XVar.Clone(data["isTruncated"]);
            processedValue = XVar.Clone(data["value"]);
            if (XVar.Pack(this.searchHighlight))
            {
                if (XVar.Pack(isTruncated))
                {
                    processedValue = XVar.Clone(highlightTruncatedBeforeMore((XVar)(value), (XVar)(processedValue), (XVar)(cNumberOfChars), (XVar)(data["truncLength"])));
                }
                else
                {
                    processedValue = XVar.Clone(highlightSearchWord((XVar)(processedValue), new XVar(false), new XVar("")));
                }
            }
            if (XVar.Pack(isTruncated))
            {
                dynamic dataField = null, link = null, tName = null, var_params = null;
                tName          = XVar.Clone(getContainer().tName);
                var_params     = XVar.Clone(MVCFunctions.Concat("pagetype=", this.container.pSet._viewPage, "&table=", CommonFunctions.GetTableURL((XVar)(tName)), "&field=", MVCFunctions.RawUrlEncode((XVar)(this.field)), keylink));
                dataField      = XVar.Clone(MVCFunctions.Concat("data-field=\"", MVCFunctions.runner_htmlspecialchars((XVar)(this.field)), "\""));
                link           = XVar.Clone(MVCFunctions.Concat(" <a href=\"javascript:void(0);\" data-gridlink data-query=\"", MVCFunctions.GetTableLink(new XVar("fulltext")), "?", var_params, "\" ", dataField, ">", "Más", "&nbsp;...</a>"));
                processedValue = MVCFunctions.Concat(processedValue, link);
            }
            return(processedValue);
        }