From: Steve Sutton Date: Thu, 21 Jul 2016 21:16:32 +0000 (-0400) Subject: WIP for working on the lead import from GF X-Git-Tag: v1.0.0^2~12 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=993595ada378d274ce89563481db1360bbef4001;p=WP-Plugins%2Fglm-member-db-leads.git WIP for working on the lead import from GF Working through gravity form leads to import them into our leads and lead_entry tables. Can only import ones with email addresses. --- diff --git a/config/plugin.ini b/config/plugin.ini index f77a99c..413068d 100644 --- a/config/plugin.ini +++ b/config/plugin.ini @@ -2,7 +2,26 @@ ; Main Configuration File ; Gaslight Media Members Database Leads Add-On Plugin ; -; Place any static configuration parameters here. +; Place any static configuration parameters here. ; [common] + +; This array is used to check the Gravity Form Fields +; for a specific inputName. Which is setup on the fields +; advanced setting under Dynamically fill > parameter name +mapped_keys[] = "fname" +mapped_keys[] = "lname" +mapped_keys[] = "org" +mapped_keys[] = "addr1" +mapped_keys[] = "addr2" +mapped_keys[] = "city" +mapped_keys[] = "state" +mapped_keys[] = "zip" +mapped_keys[] = "country" +mapped_keys[] = "email" +mapped_keys[] = "phone" +mapped_keys[] = "phone2" +mapped_keys[] = "fax" +mapped_keys[] = "mail_ok" +mapped_keys[] = "member_ok" diff --git a/index.php b/index.php index f163f86..f16f667 100644 --- a/index.php +++ b/index.php @@ -38,7 +38,7 @@ * version from this plugin. */ define('GLM_MEMBERS_LEADS_PLUGIN_VERSION', '0.0.1'); -define('GLM_MEMBERS_LEADS_PLUGIN_DB_VERSION', '0.0.3'); +define('GLM_MEMBERS_LEADS_PLUGIN_DB_VERSION', '0.0.4'); // This is the minimum version of the GLM Members DB plugin require for this plugin. define('GLM_MEMBERS_LEADS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.0.5'); diff --git a/models/admin/management/leads.php b/models/admin/management/leads.php index 2675e96..05c228c 100644 --- a/models/admin/management/leads.php +++ b/models/admin/management/leads.php @@ -124,6 +124,10 @@ class GlmMembersAdmin_management_leads // extends GlmDataLeadsManagement $form_id = false; $import_fields = false; $importing = false; + $option_name = GLM_MEMBERS_LEADS_PLUGIN_IMPORT_OPTION; + $page_size = 20; + $offset = false; + $next_offset = false; // Grab data from the Sources table $sources = $this->wpdb->get_results( @@ -151,69 +155,91 @@ class GlmMembersAdmin_management_leads // extends GlmDataLeadsManagement switch( $option2 ) { case 'import': + $result = ''; if ( isset( $_REQUEST['form_id'] ) ) { $form_id = filter_var( $_REQUEST['form_id'], FILTER_VALIDATE_INT ); - $result = '
$_REQUEST: ' . print_r( $_REQUEST, true ) . '
'; + //$result = '
$_REQUEST: ' . print_r( $_REQUEST, true ) . '
'; } if ( $form_id ) { $form = GFAPI::get_form( $form_id ); - $result = '
$form: ' . print_r( $form, true ) . '
'; + //$result = '
$form: ' . print_r( $form, true ) . '
'; //$result = '
$_REQUEST: ' . print_r( $_REQUEST, true ) . '
'; } + if ( $form_id ) { + $option_name = GLM_MEMBERS_LEADS_PLUGIN_IMPORT_OPTION . '_form_' . $form_id; + } if ( $importing ) { /* + * ONLY if $_REQUEST['import_fields'] is given * If they import-fields are being posted then save as - * wordpress option. Using update_option here incase the option + * WordPress option. Using update_option here in case the option * already exists. */ - update_option( GLM_MEMBERS_LEADS_PLUGIN_IMPORT_OPTION, serialize( $_REQUEST['import_fields'] ) ); + if ( $_REQUEST['import_fields'] ) { + update_option( + $option_name, + serialize( $_REQUEST['import_fields'] ) + ); + } // try to get import fields options - $import_fields = unserialize( get_option( GLM_MEMBERS_LEADS_PLUGIN_IMPORT_OPTION, false ) ); + $import_fields = unserialize( get_option( $option_name, false ) ); // go through the $import_fields array and find all fields // that are needed for the import $import_fields = array_filter( $import_fields ); + if ( isset( $_REQUEST['offset'] ) ) { + $offset = filter_var( $_REQUEST['offset'], FILTER_VALIDATE_INT ); + } + $offset = filter_var( $_REQUEST['offset'], FILTER_VALIDATE_INT ); - $search_criteria = array( 'status' => 'active' ); - $sorting = array(); - $paging = array( 'offset' => 0, 'page_size' => 100 ); - $total_count = 0; - $entries = GFAPI::get_entries( $form_id, $search_criteria, $sorting, $paging, $total_count ); - $result = '
$import_fields: ' . print_r( $import_fields, true ) . '
'; - $result .= '

Total County: ' . $total_count . '

'; - $result .= '
$entries: ' . print_r( $entries, true ) . '
'; - if ( $entries ) { - foreach ( $entries as $entry ) { - $lead_entry = array( - 'fname' => '', - 'lname' => '', - 'org' => '', - 'addr1' => '', - 'addr2' => '', - 'city' => '', - 'state' => '', - 'zip' => '', - 'country' => '', - 'email' => '', - 'phone' => '', - 'phone2' => '', - 'fax' => '', - 'mail_ok' => '', - 'member_ok' => '' - ); + // Only get the entries when we have offset given and it is not === false + if ( $offset !== false ) { + $next_offset = $offset + $page_size; + // Setup arguments for the get_entries call. + $search_criteria = array( 'status' => 'active' ); + $sorting = array(); + $paging = array( 'offset' => $offset, 'page_size' => $page_size ); + $total_count = 0; + $entries = GFAPI::get_entries( $form_id, $search_criteria, $sorting, $paging, $total_count ); + $result = '
$import_fields: ' . print_r( $import_fields, true ) . '
'; + //$result .= '
$_REQUEST: ' . print_r( $_REQUEST, true ) . '
'; + $result .= '

Total Count: ' . $total_count . '

'; + //$result .= '
$entries: ' . print_r( $entries, true ) . '
'; + if ( $entries ) { + foreach ( $entries as $entry ) { + $this->addEntry( $entry, $import_fields ); + } + } + } else { + $next_offset = 0; + /* If your here then it is the first page after the form setup + * Let's get the interest groups and interests created from the form + */ + $mapped_keys = $this->config['mapped_keys']; + $result = '
$mapped_keys: ' . print_r( $mapped_keys, true ) . '
'; + $result .= '
$import_fields: ' . print_r( $import_fields, true ) . '
'; + $array_diff = array_diff( $import_fields, $mapped_keys ); + $result .= '
$array_diff: ' . print_r( $array_diff, true ) . '
'; + if ( !empty( $array_diff ) ) { + foreach ( $array_diff as $group_id => $group_name ) { + $this->addInterestGroup( $form, $group_id, $group_name ); + } } + //$result .= '
$form: ' . print_r( $form, true ) . '
'; + // anything in this $array_diff will be our new interest_groups + } } else { // try to get import fields options - $import_fields = unserialize( get_option( GLM_MEMBERS_LEADS_PLUGIN_IMPORT_OPTION, false ) ); + $import_fields = unserialize( get_option( $option_name, false ) ); } break; default: $forms = GFAPI::get_forms(); - $result = '
$forms: ' . print_r( $forms, true ) . '
'; + //$result = '
$forms: ' . print_r( $forms, true ) . '
'; break; } @@ -226,6 +252,8 @@ class GlmMembersAdmin_management_leads // extends GlmDataLeadsManagement 'sources' => $sources, 'option2' => $option2, 'result' => $result, + 'offset' => $offset, + 'next_offset' => $next_offset, ); // Return status, suggested view, and data to controller @@ -240,4 +268,208 @@ class GlmMembersAdmin_management_leads // extends GlmDataLeadsManagement } + public function addInterestGroup( $form, $field_id, $group_name ) { + $interests = array(); + // go through the $form array and get all the inputs for the group_name field + if ( isset( $form['fields'] ) && is_array( $form['fields'] ) && !empty( $form['fields'] ) ) { + foreach ( $form['fields'] as $fields ) { + // Only need to get the field that matches $field_id + if ( $fields['id'] === $field_id ) { + switch ( $fields['type'] ) { + case 'checkbox': + if ( isset( $fields['inputs'] ) && is_array( $fields['inputs'] ) && !empty( $fields['inputs'] ) ) { + $interests = $fields['inputs']; + //echo '
$fields[inputs]: ' . print_r( $fields['inputs'], true ) . '
'; + } + break; + } + } + } + } + if ( $interests ) { + // Add the Group + $group_id = $this->addGroup( $group_name ); + if ( !$group_id ) { + throw Exception( 'Group not added' ); + } + foreach ( $interests as $interest ) { + $this->addInterest( $group_id, $interest['id'], $interest['label'] ); + } + } + } + + /** + * addGroup + * + * If the group is found it simply returns the group id. + * If the group is not found it will add the group and return the new id. + * + * @param mixed $name + * + * @access public + * @return int The id of the group + */ + public function addGroup( $name ) { + // check for this group first. + $group = $this->wpdb->get_var( + $this->wpdb->prepare( + "SELECT id + FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "interest_groups + WHERE title = %s", + $name + ) + ); + if ( $group ) { + return $group; + } else { + // It is not in the db so add it. + $this->wpdb->insert( + GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . 'interest_groups', + array( 'title' => $name ), + array( '%s' ) + ); + return $this->wpdb->insert_id; + } + } + + /** + * addInterest + * + * If the interest is found it simply returns the id. + * If the interest is not found for that group_id it will be added. + * The new id is returned. + * + * @param $group_id Group id for the lead interest_groups + * @param $gf_field_id Gravity Form Field Id for field input + * @param $name Name of the Interest + * + * @return int The id of the Interest + */ + public function addInterest( $group_id, $gf_field_id, $name ) { + // check for this interest first. + $interest = $this->wpdb->get_var( + $this->wpdb->prepare( + "SELECT id + FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "interests + WHERE title = %s + AND group_id = %d", + $name, + $group_id + ) + ); + if ( $interest ) { + return $interest; + } else { + // It is not in the db so add it. + $this->wpdb->insert( + GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . 'interests', + array( + 'title' => $name, + 'group_id' => $group_id, + 'gf_field_id' => $gf_field_id + ), + array( '%s', '%d', '%s' ) + ); + return $this->wpdb->insert_id; + } + } + public function addEntry( $entry, $import_fields ) { + $lead = array(); + $mapped_keys = $this->config['mapped_keys']; + + if ( $entry ) { + $entry = array_filter( $entry ); + echo '
$entry: ' . print_r( $entry, true ) . '
'; + foreach ( $import_fields as $field_id => $mapped_name ) { + if ( isset( $entry[$field_id] ) ) { + $lead[$mapped_name] = $entry[$field_id]; + } + } + echo '
$lead: ' . print_r( $lead, true ) . '
'; + // If they don't have email then we cannot add them into leads table. + if ( !isset( $lead['email'] ) ) { + return false; + } + $member_lead_id = $this->addMemberLead( $lead ); + echo '
$member_lead_id: ' . print_r( $member_lead_id, true ) . '
'; + + } + } + /** + * addMemberLead + * + * Check to see if leads already contains one with the same email. + * If not then create one. + * Returns the id of the lead. + * + * @param mixed $lead Array with the lead email, mail_ok, member_ok fields + * + * @access public + * @return mixed False if no email is given. Lead id if found or inserted. + */ + public function addMemberLead( $lead ) { + if ( !isset( $lead['email'] ) || !filter_var( $lead['email'], FILTER_VALIDATE_EMAIL ) ) { + return false; + } + $lead_id = $this->wpdb->get_var( + $this->wpdb->prepare( + "SELECT id + FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "leads + WHERE email = %s", + $lead['email'] + ) + ); + if ( $lead_id ) { + return $lead_id; + } else { + $mapped_keys = $this->config['mapped_keys']; + $this->wpdb->insert( + GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . 'leads', + array( + 'email' => $lead['email'], + 'mail_ok' => ( $lead['mail_ok'] ) ? 1 : 0, + 'member_ok' => ( $lead['member_ok'] ) ? 1 : 0, + ), + array( '%s', '%s', '%s' ) + ); + return $this->wpdb->insert_id; + } + } + /** + * addMemberLeadEntry + * + * @param mixed $lead_id Id from the leads table + * @param mixed $lead Lead array + * @param mixed $entry Entry array + * + * @access public + * @return void + */ + public function addMemberLeadEntry( $lead_id, $lead, $entry ) { + if ( !isset( $lead_id ) || !filter_var( $lead_id, FILTER_VALIDATE_INT ) ) { + return false; + } + if ( !isset( $lead ) || !is_array( $lead ) ) { + return false; + } + $this->wpdb->insert( + GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . 'lead_entry', + array( + 'fname' => '', + 'lname' => '', + 'org' => '', + 'addr1' => '', + 'addr2' => '', + 'city' => '', + 'state' => '', + 'zip' => '', + 'country' => '', + 'phone' => '', + 'phone2' => '', + 'fax' => '', + 'user_trace_info' => '', + ), + array() + ); + } } diff --git a/savesession b/savesession new file mode 100644 index 0000000..c9bd0e3 --- /dev/null +++ b/savesession @@ -0,0 +1,1056 @@ +let SessionLoad = 1 +if &cp | set nocp | endif +let s:cpo_save=&cpo +set cpo&vim +inoremap =UltiSnips#ListSnippets() +snoremap  c +xnoremap  :call UltiSnips#SaveLastVisualSelection() gvs +snoremap  :call UltiSnips#ExpandSnippet() +map  :NERDTreeToggle +snoremap  "_c +xmap ,pa PIVphpAlign +nmap ,pa PIVphpAlign +xmap ,pd PIVphpDocRange +nmap ,pd PIVphpDocSingle +nmap ,w,y VimwikiMakeYesterdayDiaryNote +nmap ,w,t VimwikiTabMakeDiaryNote +nmap ,w,w VimwikiMakeDiaryNote +nmap ,w,i VimwikiDiaryGenerateLinks +nmap ,wi VimwikiDiaryIndex +nmap ,ws VimwikiUISelect +nmap ,wt VimwikiTabIndex +nmap ,ww VimwikiIndex +nmap ,j (CommandTJump) +nmap ,b (CommandTBuffer) +nmap ,t (CommandT) +nmap ,n :tabnext +xmap ,n :tabnext +omap ,n :tabnext +nmap ,p :tabprev +xmap ,p :tabprev +omap ,p :tabprev +nmap ,gp :Git push +xmap ,gp :Git push +omap ,gp :Git push +nmap ,gl :Glog +xmap ,gl :Glog +omap ,gl :Glog +nmap ,gb :Gblame +xmap ,gb :Gblame +omap ,gb :Gblame +nmap ,gc :Gcommit +xmap ,gc :Gcommit +omap ,gc :Gcommit +nmap ,gd :Gdiff +xmap ,gd :Gdiff +omap ,gd :Gdiff +nmap ,gs :Gstatus +xmap ,gs :Gstatus +omap ,gs :Gstatus +xmap ,a: :Tabularize /:\zs +nmap ,a: :Tabularize /:\zs +xmap ,a= :Tabularize /= +nmap ,a= :Tabularize /= +nmap ,v :tabedit $MYVIMRC +nmap ,l :set list! +vnoremap <  >gv " better indentation +nmap Q gq +xmap Q gq +omap Q gq +xmap [% [%m'gv`` +xmap ]% ]%m'gv`` +xmap a% [%v]% +nmap cr Coerce +xmap gx NetrwBrowseXVis +nmap gx NetrwBrowseX +noremap AirlineSelectNextTab :exe repeat(':tabn|', v:count1) +noremap AirlineSelectPrevTab gT +noremap AirlineSelectTab9 :9tabn +noremap AirlineSelectTab8 :8tabn +noremap AirlineSelectTab7 :7tabn +noremap AirlineSelectTab6 :6tabn +noremap AirlineSelectTab5 :5tabn +noremap AirlineSelectTab4 :4tabn +noremap AirlineSelectTab3 :3tabn +noremap AirlineSelectTab2 :2tabn +noremap AirlineSelectTab1 :1tabn +vnoremap PIVphpAlign :call PhpAlign() +vnoremap PIVphpDocRange :call PhpDocRange() +nnoremap PIVphpDocSingle :call PhpDocSingle() +vnoremap NetrwBrowseXVis :call netrw#BrowseXVis() +nnoremap NetrwBrowseX :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '')),netrw#CheckIfRemote()) +snoremap c +snoremap c +snoremap :call UltiSnips#ListSnippets() +nnoremap (CommandTTag) :CommandTTag +nnoremap (CommandTSearch) :CommandTSearch +nnoremap (CommandTMRU) :CommandTMRU +nnoremap (CommandTLine) :CommandTLine +nnoremap (CommandTCommand) :CommandTCommand +nnoremap (CommandTJump) :CommandTJump +nnoremap (CommandTHistory) :CommandTHistory +nnoremap (CommandTHelp) :CommandTHelp +nnoremap (CommandTBuffer) :CommandTBuffer +nnoremap (CommandT) :CommandT +nnoremap 21_: :=v:count ? v:count : '' +map :DisablePHPFolds +map :EnablePHPFolds +map :EnableFastPHPFolds +nmap :TagbarToggle +noremap +noremap +noremap +noremap +map :syntax sync fromstart +inoremap  =UltiSnips#ExpandSnippet() +let &cpo=s:cpo_save +unlet s:cpo_save +set autoindent +set background=dark +set backspace=2 +set expandtab +set fileencodings=ucs-bom,utf-8,default,latin1 +set helplang=en +set hlsearch +set keywordprg=:help +set listchars=tab:▸\ ,eol:¬ +set mouse=a +set ruler +set runtimepath=~/.vim,~/.vim/bundle/Vundle.vim,~/.vim/bundle/vim-fugitive,~/.vim/bundle/L9,~/.vim/bundle/command-t,~/.vim/bundle/sparkup/vim/,~/.vim/bundle/ultisnips,~/.vim/bundle/vim-abolish,~/.vim/bundle/vim-colorschemes,~/.vim/bundle/tabular,~/.vim/bundle/PIV,~/.vim/bundle/vim-autotag,~/.vim/bundle/vimwiki,~/.vim/bundle/nerdtree,~/.vim/bundle/vim-airline,~/.vim/bundle/vim-airline-themes,~/.vim/bundle/vim-bufferline,~/.vim/bundle/tagbar,~/.vim/bundle/vim-javascript,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,~/.vim/after,~/.vim/bundle/Vundle.vim,~/.vim/bundle/Vundle.vim/after,~/.vim/bundle/vim-fugitive/after,~/.vim/bundle/L9/after,~/.vim/bundle/command-t/after,~/.vim/bundle/sparkup/vim//after,~/.vim/bundle/ultisnips/after,~/.vim/bundle/vim-abolish/after,~/.vim/bundle/vim-colorschemes/after,~/.vim/bundle/tabular/after,~/.vim/bundle/PIV/after,~/.vim/bundle/vim-autotag/after,~/.vim/bundle/vimwiki/after,~/.vim/bundle/nerdtree/after,~/.vim/bundle/vim-airline/after,~/.vim/bundle/vim-airline-themes/after,~/.vim/bundle/vim-bufferline/after,~/.vim/bundle/tagbar/after,~/.vim/bundle/vim-javascript/after +set shiftwidth=4 +set showtabline=2 +set softtabstop=4 +set suffixes=.bak,~,.o,.h,.info,.swp,.obj,.info,.aux,.log,.dvi,.bbl,.out,.o,.lo +set tabline=%!airline#extensions#tabline#get() +set tabstop=4 +let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0 +let v:this_session=expand(":p") +silent only +cd /var/www/saultstemarie/wp-content/plugins/glm-member-db-leads +if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == '' + let s:wipebuf = bufnr('%') +endif +set shortmess=aoO +badd +112 models/admin/leads/index.php +badd +305 models/admin/management/leads.php +badd +38 defines.php +badd +0 views/admin/management/leads.html +badd +146 setup/frontHooks.php +badd +27 config/plugin.ini +badd +88 setup/databaseScripts/create_database_V0.0.4.sql +badd +1 setup/databaseScripts/create_database_V0.0.3.sql +badd +11 setup/databaseScripts/update_database_V0.0.4.sql +badd +20 setup/databaseScripts/dbVersions.php +badd +0 index.php +argglobal +silent! argdel * +argadd models/admin/leads/index.php +edit index.php +set splitbelow splitright +wincmd _ | wincmd | +vsplit +1wincmd h +wincmd _ | wincmd | +split +wincmd _ | wincmd | +split +2wincmd k +wincmd w +wincmd w +wincmd w +wincmd _ | wincmd | +split +1wincmd k +wincmd w +set nosplitbelow +set nosplitright +wincmd t +set winheight=1 winwidth=1 +exe '1resize ' . ((&lines * 27 + 42) / 84) +exe 'vert 1resize ' . ((&columns * 133 + 139) / 279) +exe '2resize ' . ((&lines * 26 + 42) / 84) +exe 'vert 2resize ' . ((&columns * 133 + 139) / 279) +exe '3resize ' . ((&lines * 26 + 42) / 84) +exe 'vert 3resize ' . ((&columns * 133 + 139) / 279) +exe '4resize ' . ((&lines * 40 + 42) / 84) +exe 'vert 4resize ' . ((&columns * 145 + 139) / 279) +exe '5resize ' . ((&lines * 40 + 42) / 84) +exe 'vert 5resize ' . ((&columns * 145 + 139) / 279) +argglobal +onoremap [[ ?\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)? :nohls +nnoremap [[ ?\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)? :nohls +onoremap ]] /\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)/ :nohls +nnoremap ]] /\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)/ :nohls +let s:cpo_save=&cpo +set cpo&vim +imap  SparkupExecute +imap  SparkupNext +let &cpo=s:cpo_save +unlet s:cpo_save +setlocal keymap= +setlocal noarabic +setlocal noautoindent +setlocal backupcopy= +setlocal nobinary +setlocal nobreakindent +setlocal breakindentopt= +setlocal bufhidden= +setlocal buflisted +setlocal buftype= +setlocal nocindent +setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e +setlocal cinoptions= +setlocal cinwords=if,else,while,do,for,switch +setlocal colorcolumn= +setlocal comments=s1:/*,mb:*,ex:*/,://,:# +setlocal commentstring=/*%s*/ +setlocal complete=.,w,b,u,t,i +setlocal concealcursor= +setlocal conceallevel=0 +setlocal completefunc= +setlocal nocopyindent +setlocal cryptmethod= +setlocal nocursorbind +setlocal nocursorcolumn +setlocal nocursorline +setlocal define= +setlocal dictionary= +setlocal nodiff +setlocal equalprg= +setlocal errorformat= +setlocal expandtab +if &filetype != 'php' +setlocal filetype=php +endif +setlocal foldcolumn=0 +setlocal nofoldenable +setlocal foldexpr=0 +setlocal foldignore=# +setlocal foldlevel=0 +setlocal foldmarker={{{,}}} +setlocal foldmethod=manual +setlocal foldminlines=1 +setlocal foldnestmax=20 +set foldtext=PHPFoldText() +setlocal foldtext=PHPFoldText() +setlocal formatexpr= +setlocal formatoptions=qrowcb +setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* +setlocal grepprg= +setlocal iminsert=0 +setlocal imsearch=0 +setlocal include=\\(require\\|include\\)\\(_once\\)\\? +setlocal includeexpr= +setlocal indentexpr=GetPhpIndent() +setlocal indentkeys=0{,0},0),:,!^F,o,O,e,*,=?>,= +setlocal modeline +setlocal modifiable +setlocal nrformats=octal,hex +set number +setlocal number +setlocal numberwidth=4 +setlocal omnifunc=phpcomplete#CompletePHP +setlocal path= +setlocal nopreserveindent +setlocal nopreviewwindow +setlocal quoteescape=\\ +setlocal noreadonly +setlocal norelativenumber +setlocal norightleft +setlocal rightleftcmd=search +setlocal noscrollbind +setlocal shiftwidth=4 +setlocal noshortname +setlocal nosmartindent +setlocal softtabstop=4 +set spell +setlocal spell +setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ +setlocal spellfile= +setlocal spelllang=en +setlocal statusline=%!airline#statusline(1) +setlocal suffixesadd= +setlocal swapfile +setlocal synmaxcol=3000 +if &syntax != 'php' +setlocal syntax=php +endif +setlocal tabstop=4 +setlocal tags= +setlocal textwidth=0 +setlocal thesaurus= +setlocal noundofile +setlocal undolevels=-123456 +setlocal nowinfixheight +setlocal nowinfixwidth +setlocal wrap +setlocal wrapmargin=0 +silent! normal! zE +40,40fold +41,41fold +44,44fold +81,81fold +84,84fold +87,87fold +103,110fold +119,128fold +131,131fold +139,139fold +140,140fold +142,142fold +151,181fold +194,194fold +191,196fold +203,203fold +200,206fold +212,212fold +214,218fold +229,229fold +223,233fold +let s:l = 97 - ((21 * winheight(0) + 13) / 27) +if s:l < 1 | let s:l = 1 | endif +exe s:l +normal! zt +97 +normal! 0 +wincmd w +argglobal +edit setup/databaseScripts/create_database_V0.0.4.sql +let s:cpo_save=&cpo +set cpo&vim +inoremap =sqlcomplete#DrillOutOfColumns() +inoremap =sqlcomplete#DrillIntoTable() +xnoremap [" :exec "normal! gv"|call search('\(^\s*\(--\|\/\/\|\*\|\/\*\|\*\/\).*\n\)\(^\s*\(--\|\/\/\|\*\|\/\*\|\*\/\)\)\@!', "W" ) +nnoremap [" :call search('\(^\s*\(--\|\/\/\|\*\|\/\*\|\*\/\).*\n\)\(^\s*\(--\|\/\/\|\*\|\/\*\|\*\/\)\)\@!', "W" ) +xnoremap [{ ?\c^\s*\(\(create\)\s\+\(or\s\+replace\s\+\)\{,1}\)\{,1}\<\(function\|procedure\|event\|\(existing\|global\s\+temporary\s\+\)\{,1}table\|trigger\|schema\|service\|publication\|database\|datatype\|domain\|index\|subscription\|synchronization\|view\|variable\)\> +nnoremap [{ :call search('\c^\s*\(\(create\)\s\+\(or\s\+replace\s\+\)\{,1}\)\{,1}\<\(function\|procedure\|event\|\(existing\|global\s\+temporary\s\+\)\{,1}table\|trigger\|schema\|service\|publication\|database\|datatype\|domain\|index\|subscription\|synchronization\|view\|variable\)\>', 'bW') +xnoremap [] :exec "normal! gv"|call search('\c^\s*end\W*$', 'bW' ) +xnoremap [[ :exec "normal! gv"|call search('\c^\s*begin\>', 'bW' ) +nnoremap [] :call search('\c^\s*end\W*$', 'bW' ) +nnoremap [[ :call search('\c^\s*begin\>', 'bW' ) +xnoremap ]" :exec "normal! gv"|call search('^\(\s*\(--\|\/\/\|\*\|\/\*\|\*\/\).*\n\)\@ ]" :call search('^\(\s*\(--\|\/\/\|\*\|\/\*\|\*\/\).*\n\)\@ ]} /\c^\s*\(\(create\)\s\+\(or\s\+replace\s\+\)\{,1}\)\{,1}\<\(function\|procedure\|event\|\(existing\|global\s\+temporary\s\+\)\{,1}table\|trigger\|schema\|service\|publication\|database\|datatype\|domain\|index\|subscription\|synchronization\|view\|variable\)\> +nnoremap ]} :call search('\c^\s*\(\(create\)\s\+\(or\s\+replace\s\+\)\{,1}\)\{,1}\<\(function\|procedure\|event\|\(existing\|global\s\+temporary\s\+\)\{,1}table\|trigger\|schema\|service\|publication\|database\|datatype\|domain\|index\|subscription\|synchronization\|view\|variable\)\>', 'W') +xnoremap ][ :exec "normal! gv"|call search('\c^\s*end\W*$', 'W' ) +xnoremap ]] :exec "normal! gv"|call search('\c^\s*begin\>', 'W' ) +nnoremap ][ :call search('\c^\s*end\W*$', 'W' ) +nnoremap ]] :call search('\c^\s*begin\>', 'W' ) +inoremap R :call sqlcomplete#Map("resetCache")  +inoremap L :call sqlcomplete#Map("column_csv")  +inoremap l :call sqlcomplete#Map("column_csv")  +inoremap c :call sqlcomplete#Map("column")  +inoremap v :call sqlcomplete#Map("view")  +inoremap p :call sqlcomplete#Map("procedure")  +inoremap t :call sqlcomplete#Map("table")  +inoremap s :call sqlcomplete#Map("sqlStatement\\w*")  +inoremap T :call sqlcomplete#Map("sqlType\\w*")  +inoremap o :call sqlcomplete#Map("sqlOption\\w*")  +inoremap f :call sqlcomplete#Map("sqlFunction\\w*")  +inoremap k :call sqlcomplete#Map("sqlKeyword\\w*")  +inoremap a :call sqlcomplete#Map("syntax")  +let &cpo=s:cpo_save +unlet s:cpo_save +setlocal keymap= +setlocal noarabic +setlocal autoindent +setlocal backupcopy= +setlocal nobinary +setlocal nobreakindent +setlocal breakindentopt= +setlocal bufhidden= +setlocal buflisted +setlocal buftype= +setlocal nocindent +setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e +setlocal cinoptions= +setlocal cinwords=if,else,while,do,for,switch +setlocal colorcolumn= +setlocal comments=s1:/*,mb:*,ex:*/,:--,:// +setlocal commentstring=/*%s*/ +setlocal complete=.,w,b,u,t,i +setlocal concealcursor= +setlocal conceallevel=0 +setlocal completefunc= +setlocal nocopyindent +setlocal cryptmethod= +setlocal nocursorbind +setlocal nocursorcolumn +setlocal nocursorline +setlocal define=\\c\\<\\(VARIABLE\\|DECLARE\\|IN\\|OUT\\|INOUT\\)\\> +setlocal dictionary= +setlocal nodiff +setlocal equalprg= +setlocal errorformat= +setlocal expandtab +if &filetype != 'sql' +setlocal filetype=sql +endif +setlocal foldcolumn=0 +setlocal foldenable +setlocal foldexpr=0 +setlocal foldignore=# +setlocal foldlevel=0 +setlocal foldmarker={{{,}}} +setlocal foldmethod=manual +setlocal foldminlines=1 +setlocal foldnestmax=20 +set foldtext=PHPFoldText() +setlocal foldtext=PHPFoldText() +setlocal formatexpr= +setlocal formatoptions=qc +setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* +setlocal grepprg= +setlocal iminsert=0 +setlocal imsearch=0 +setlocal include= +setlocal includeexpr= +setlocal indentexpr=GetSQLIndent() +setlocal indentkeys=!^F,o,O,=~end,=~else,=~elseif,=~elsif,0=~when,0=) +setlocal noinfercase +setlocal iskeyword=@,48-57,_,192-255 +setlocal keywordprg= +setlocal nolinebreak +setlocal nolisp +setlocal lispwords= +set list +setlocal list +setlocal makeprg= +setlocal matchpairs=(:),{:},[:],<:> +setlocal modeline +setlocal modifiable +setlocal nrformats=octal,hex +set number +setlocal number +setlocal numberwidth=4 +setlocal omnifunc=sqlcomplete#Complete +setlocal path= +setlocal nopreserveindent +setlocal nopreviewwindow +setlocal quoteescape=\\ +setlocal noreadonly +setlocal norelativenumber +setlocal norightleft +setlocal rightleftcmd=search +setlocal noscrollbind +setlocal shiftwidth=4 +setlocal noshortname +setlocal nosmartindent +setlocal softtabstop=4 +set spell +setlocal spell +setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ +setlocal spellfile= +setlocal spelllang=en +setlocal statusline=%!airline#statusline(2) +setlocal suffixesadd= +setlocal swapfile +setlocal synmaxcol=3000 +if &syntax != 'sql' +setlocal syntax=sql +endif +setlocal tabstop=4 +setlocal tags= +setlocal textwidth=0 +setlocal thesaurus= +setlocal noundofile +setlocal undolevels=-123456 +setlocal nowinfixheight +setlocal nowinfixwidth +setlocal wrap +setlocal wrapmargin=0 +silent! normal! zE +let s:l = 74 - ((5 * winheight(0) + 13) / 26) +if s:l < 1 | let s:l = 1 | endif +exe s:l +normal! zt +74 +normal! 022| +wincmd w +argglobal +edit models/admin/leads/index.php +vnoremap ' "zdi'z' +vnoremap ( "zdi(z) +onoremap [[ ?\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)? :nohls +nnoremap [[ ?\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)? :nohls +vnoremap [ "zdi[z] +onoremap ]] /\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)/ :nohls +nnoremap ]] /\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)/ :nohls +vnoremap { "zdi{z} +let s:cpo_save=&cpo +set cpo&vim +imap  SparkupExecute +inoremap  :!phpm =expand("")  +imap  SparkupNext +let &cpo=s:cpo_save +unlet s:cpo_save +setlocal keymap= +setlocal noarabic +setlocal noautoindent +setlocal backupcopy= +setlocal nobinary +setlocal nobreakindent +setlocal breakindentopt= +setlocal bufhidden= +setlocal buflisted +setlocal buftype= +setlocal nocindent +setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e +setlocal cinoptions= +setlocal cinwords=if,else,while,do,for,switch +setlocal colorcolumn= +setlocal comments=s1:/*,mb:*,ex:*/,://,:# +setlocal commentstring=/*%s*/ +setlocal complete=.,w,b,u,t,i,k +setlocal concealcursor= +setlocal conceallevel=0 +setlocal completefunc= +setlocal nocopyindent +setlocal cryptmethod= +setlocal nocursorbind +setlocal nocursorcolumn +setlocal nocursorline +setlocal define= +setlocal dictionary=/usr/share/vim/vim74/bundle/PIV/misc/funclist.txt +setlocal nodiff +setlocal equalprg= +setlocal errorformat=%m\ in\ %f\ on\ line\ %l +setlocal expandtab +if &filetype != 'php' +setlocal filetype=php +endif +setlocal foldcolumn=0 +setlocal foldenable +setlocal foldexpr=0 +setlocal foldignore=# +setlocal foldlevel=0 +setlocal foldmarker={{{,}}} +setlocal foldmethod=manual +setlocal foldminlines=1 +setlocal foldnestmax=20 +set foldtext=PHPFoldText() +setlocal foldtext=PHPFoldText() +setlocal formatexpr= +setlocal formatoptions=qrowcb +setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* +setlocal grepprg= +setlocal iminsert=0 +setlocal imsearch=0 +setlocal include=\\(require\\|include\\)\\(_once\\)\\? +setlocal includeexpr= +setlocal indentexpr=GetPhpIndent() +setlocal indentkeys=0{,0},0),:,!^F,o,O,e,*,=?>,= +setlocal modeline +setlocal modifiable +setlocal nrformats=octal,hex +set number +setlocal number +setlocal numberwidth=4 +setlocal omnifunc=phpcomplete#CompletePHP +setlocal path= +setlocal nopreserveindent +setlocal nopreviewwindow +setlocal quoteescape=\\ +setlocal noreadonly +setlocal norelativenumber +setlocal norightleft +setlocal rightleftcmd=search +setlocal noscrollbind +setlocal shiftwidth=4 +setlocal noshortname +setlocal nosmartindent +setlocal softtabstop=4 +set spell +setlocal spell +setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ +setlocal spellfile= +setlocal spelllang=en +setlocal statusline=%!airline#statusline(3) +setlocal suffixesadd= +setlocal swapfile +setlocal synmaxcol=3000 +if &syntax != 'php' +setlocal syntax=php +endif +setlocal tabstop=4 +setlocal tags= +setlocal textwidth=79 +setlocal thesaurus= +setlocal noundofile +setlocal undolevels=-123456 +setlocal nowinfixheight +setlocal nowinfixwidth +setlocal nowrap +setlocal wrapmargin=0 +silent! normal! zE +17,17fold +18,18fold +19,19fold +20,20fold +66,85fold +283,285fold +460,460fold +466,466fold +544,544fold +719,719fold +745,745fold +86,822fold +86 +normal! zo +let s:l = 146 - ((8 * winheight(0) + 13) / 26) +if s:l < 1 | let s:l = 1 | endif +exe s:l +normal! zt +146 +normal! 029| +wincmd w +argglobal +edit models/admin/management/leads.php +onoremap [[ ?\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)? :nohls +nnoremap [[ ?\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)? :nohls +onoremap ]] /\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)/ :nohls +nnoremap ]] /\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)/ :nohls +let s:cpo_save=&cpo +set cpo&vim +imap  SparkupExecute +imap  SparkupNext +let &cpo=s:cpo_save +unlet s:cpo_save +setlocal keymap= +setlocal noarabic +setlocal noautoindent +setlocal backupcopy= +setlocal nobinary +setlocal nobreakindent +setlocal breakindentopt= +setlocal bufhidden= +setlocal buflisted +setlocal buftype= +setlocal nocindent +setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e +setlocal cinoptions= +setlocal cinwords=if,else,while,do,for,switch +setlocal colorcolumn= +setlocal comments=s1:/*,mb:*,ex:*/,://,:# +setlocal commentstring=/*%s*/ +setlocal complete=.,w,b,u,t,i +setlocal concealcursor= +setlocal conceallevel=0 +setlocal completefunc= +setlocal nocopyindent +setlocal cryptmethod= +setlocal nocursorbind +setlocal nocursorcolumn +setlocal nocursorline +setlocal define= +setlocal dictionary= +setlocal nodiff +setlocal equalprg= +setlocal errorformat= +setlocal expandtab +if &filetype != 'php' +setlocal filetype=php +endif +setlocal foldcolumn=0 +setlocal foldenable +setlocal foldexpr=0 +setlocal foldignore=# +setlocal foldlevel=0 +setlocal foldmarker={{{,}}} +setlocal foldmethod=manual +setlocal foldminlines=1 +setlocal foldnestmax=20 +set foldtext=PHPFoldText() +setlocal foldtext=PHPFoldText() +setlocal formatexpr= +setlocal formatoptions=qrowcb +setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* +setlocal grepprg= +setlocal iminsert=0 +setlocal imsearch=0 +setlocal include=\\(require\\|include\\)\\(_once\\)\\? +setlocal includeexpr= +setlocal indentexpr=GetPhpIndent() +setlocal indentkeys=0{,0},0),:,!^F,o,O,e,*,=?>,= +setlocal modeline +setlocal modifiable +setlocal nrformats=octal,hex +set number +setlocal number +setlocal numberwidth=4 +setlocal omnifunc=phpcomplete#CompletePHP +setlocal path= +setlocal nopreserveindent +setlocal nopreviewwindow +setlocal quoteescape=\\ +setlocal noreadonly +setlocal norelativenumber +setlocal norightleft +setlocal rightleftcmd=search +setlocal noscrollbind +setlocal shiftwidth=4 +setlocal noshortname +setlocal nosmartindent +setlocal softtabstop=4 +set spell +setlocal spell +setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ +setlocal spellfile= +setlocal spelllang=en +setlocal statusline=%!airline#statusline(4) +setlocal suffixesadd= +setlocal swapfile +setlocal synmaxcol=3000 +if &syntax != 'php' +setlocal syntax=php +endif +setlocal tabstop=4 +setlocal tags= +setlocal textwidth=0 +setlocal thesaurus= +setlocal noundofile +setlocal undolevels=-123456 +setlocal nowinfixheight +setlocal nowinfixwidth +setlocal wrap +setlocal wrapmargin=0 +silent! normal! zE +2,16fold +70,108fold +109,286fold +287,316fold +317,350fold +351,391fold +70 +normal! zo +109 +normal! zo +let s:l = 232 - ((25 * winheight(0) + 20) / 40) +if s:l < 1 | let s:l = 1 | endif +exe s:l +normal! zt +232 +normal! 037| +wincmd w +argglobal +edit models/admin/management/leads.php +onoremap [[ ?\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)? :nohls +nnoremap [[ ?\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)? :nohls +onoremap ]] /\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)/ :nohls +nnoremap ]] /\(.*\%#\)\@!\_^\s*\zs\(\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\|\(abstract\s\+\|final\s\+\)*class\|interface\)/ :nohls +let s:cpo_save=&cpo +set cpo&vim +imap  SparkupExecute +imap  SparkupNext +let &cpo=s:cpo_save +unlet s:cpo_save +setlocal keymap= +setlocal noarabic +setlocal noautoindent +setlocal backupcopy= +setlocal nobinary +setlocal nobreakindent +setlocal breakindentopt= +setlocal bufhidden= +setlocal buflisted +setlocal buftype= +setlocal nocindent +setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e +setlocal cinoptions= +setlocal cinwords=if,else,while,do,for,switch +setlocal colorcolumn= +setlocal comments=s1:/*,mb:*,ex:*/,://,:# +setlocal commentstring=/*%s*/ +setlocal complete=.,w,b,u,t,i +setlocal concealcursor= +setlocal conceallevel=0 +setlocal completefunc= +setlocal nocopyindent +setlocal cryptmethod= +setlocal nocursorbind +setlocal nocursorcolumn +setlocal nocursorline +setlocal define= +setlocal dictionary= +setlocal nodiff +setlocal equalprg= +setlocal errorformat= +setlocal expandtab +if &filetype != 'php' +setlocal filetype=php +endif +setlocal foldcolumn=0 +setlocal foldenable +setlocal foldexpr=0 +setlocal foldignore=# +setlocal foldlevel=0 +setlocal foldmarker={{{,}}} +setlocal foldmethod=manual +setlocal foldminlines=1 +setlocal foldnestmax=20 +set foldtext=PHPFoldText() +setlocal foldtext=PHPFoldText() +setlocal formatexpr= +setlocal formatoptions=qrowcb +setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* +setlocal grepprg= +setlocal iminsert=0 +setlocal imsearch=0 +setlocal include=\\(require\\|include\\)\\(_once\\)\\? +setlocal includeexpr= +setlocal indentexpr=GetPhpIndent() +setlocal indentkeys=0{,0},0),:,!^F,o,O,e,*,=?>,= +setlocal modeline +setlocal modifiable +setlocal nrformats=octal,hex +set number +setlocal number +setlocal numberwidth=4 +setlocal omnifunc=phpcomplete#CompletePHP +setlocal path= +setlocal nopreserveindent +setlocal nopreviewwindow +setlocal quoteescape=\\ +setlocal noreadonly +setlocal norelativenumber +setlocal norightleft +setlocal rightleftcmd=search +setlocal noscrollbind +setlocal shiftwidth=4 +setlocal noshortname +setlocal nosmartindent +setlocal softtabstop=4 +set spell +setlocal spell +setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ +setlocal spellfile= +setlocal spelllang=en +setlocal statusline=%!airline#statusline(5) +setlocal suffixesadd= +setlocal swapfile +setlocal synmaxcol=3000 +if &syntax != 'php' +setlocal syntax=php +endif +setlocal tabstop=4 +setlocal tags= +setlocal textwidth=0 +setlocal thesaurus= +setlocal noundofile +setlocal undolevels=-123456 +setlocal nowinfixheight +setlocal nowinfixwidth +setlocal wrap +setlocal wrapmargin=0 +silent! normal! zE +2,16fold +70,108fold +109,286fold +287,316fold +317,350fold +351,391fold +70 +normal! zo +109 +normal! zo +let s:l = 213 - ((6 * winheight(0) + 20) / 40) +if s:l < 1 | let s:l = 1 | endif +exe s:l +normal! zt +213 +normal! 049| +wincmd w +5wincmd w +exe '1resize ' . ((&lines * 27 + 42) / 84) +exe 'vert 1resize ' . ((&columns * 133 + 139) / 279) +exe '2resize ' . ((&lines * 26 + 42) / 84) +exe 'vert 2resize ' . ((&columns * 133 + 139) / 279) +exe '3resize ' . ((&lines * 26 + 42) / 84) +exe 'vert 3resize ' . ((&columns * 133 + 139) / 279) +exe '4resize ' . ((&lines * 40 + 42) / 84) +exe 'vert 4resize ' . ((&columns * 145 + 139) / 279) +exe '5resize ' . ((&lines * 40 + 42) / 84) +exe 'vert 5resize ' . ((&columns * 145 + 139) / 279) +tabedit views/admin/management/leads.html +set splitbelow splitright +set nosplitbelow +set nosplitright +wincmd t +set winheight=1 winwidth=1 +argglobal +let s:cpo_save=&cpo +set cpo&vim +imap  SparkupExecute +imap  SparkupNext +let &cpo=s:cpo_save +unlet s:cpo_save +setlocal keymap= +setlocal noarabic +setlocal autoindent +setlocal backupcopy= +setlocal nobinary +setlocal nobreakindent +setlocal breakindentopt= +setlocal bufhidden= +setlocal buflisted +setlocal buftype= +setlocal nocindent +setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e +setlocal cinoptions=j1,J1 +setlocal cinwords=if,else,while,do,for,switch +setlocal colorcolumn= +setlocal comments=s: +setlocal commentstring= +setlocal complete=.,w,b,u,t,i +setlocal concealcursor= +setlocal conceallevel=0 +setlocal completefunc= +setlocal nocopyindent +setlocal cryptmethod= +setlocal nocursorbind +setlocal nocursorcolumn +setlocal nocursorline +setlocal define= +setlocal dictionary= +setlocal nodiff +setlocal equalprg= +setlocal errorformat= +setlocal expandtab +if &filetype != 'html' +setlocal filetype=html +endif +setlocal foldcolumn=0 +setlocal foldenable +setlocal foldexpr=0 +setlocal foldignore=# +setlocal foldlevel=0 +setlocal foldmarker={{{,}}} +setlocal foldmethod=manual +setlocal foldminlines=1 +setlocal foldnestmax=20 +set foldtext=PHPFoldText() +setlocal foldtext=PHPFoldText() +setlocal formatexpr= +setlocal formatoptions=tcq +setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s* +setlocal grepprg= +setlocal iminsert=0 +setlocal imsearch=0 +setlocal include= +setlocal includeexpr= +setlocal indentexpr=HtmlIndent() +setlocal indentkeys=o,O,,<>>,{,},!^F +setlocal noinfercase +setlocal iskeyword=@,48-57,_,192-255,$ +setlocal keywordprg= +setlocal nolinebreak +setlocal nolisp +setlocal lispwords= +set list +setlocal list +setlocal makeprg= +setlocal matchpairs=(:),{:},[:],<:> +setlocal modeline +setlocal modifiable +setlocal nrformats=octal,hex +set number +setlocal number +setlocal numberwidth=4 +setlocal omnifunc=htmlcomplete#CompleteTags +setlocal path= +setlocal nopreserveindent +setlocal nopreviewwindow +setlocal quoteescape=\\ +setlocal noreadonly +setlocal norelativenumber +setlocal norightleft +setlocal rightleftcmd=search +setlocal noscrollbind +setlocal shiftwidth=4 +setlocal noshortname +setlocal nosmartindent +setlocal softtabstop=4 +set spell +setlocal spell +setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+ +setlocal spellfile= +setlocal spelllang=en +setlocal statusline=%!airline#statusline(1) +setlocal suffixesadd= +setlocal swapfile +setlocal synmaxcol=3000 +if &syntax != 'html' +setlocal syntax=html +endif +setlocal tabstop=4 +setlocal tags= +setlocal textwidth=0 +setlocal thesaurus= +setlocal noundofile +setlocal undolevels=-123456 +setlocal nowinfixheight +setlocal nowinfixwidth +setlocal wrap +setlocal wrapmargin=0 +silent! normal! zE +let s:l = 120 - ((58 * winheight(0) + 41) / 82) +if s:l < 1 | let s:l = 1 | endif +exe s:l +normal! zt +120 +normal! 0146| +tabnext 1 +if exists('s:wipebuf') + silent exe 'bwipe ' . s:wipebuf +endif +unlet! s:wipebuf +set winheight=1 winwidth=20 shortmess=filnxtToO +let s:sx = expand(":p:r")."x.vim" +if file_readable(s:sx) + exe "source " . fnameescape(s:sx) +endif +let &so = s:so_save | let &siso = s:siso_save +doautoall SessionLoadPost +unlet SessionLoad +" vim: set ft=vim : diff --git a/setup/databaseScripts/create_database_V0.0.3.sql b/setup/databaseScripts/create_database_V0.0.3.sql deleted file mode 100644 index 0ec1679..0000000 --- a/setup/databaseScripts/create_database_V0.0.3.sql +++ /dev/null @@ -1,147 +0,0 @@ --- Gaslight Media Members Database - Leads --- File Created: 16/07/19 16:16:16 --- Database Version: 0.0.3 --- Database Creation Script --- --- This file is called to create a new set of tables for this --- add-on for the most receint database version for this add-on. --- --- There should only be one such file in this directory --- --- To permit each query below to be executed separately, --- all queries must be separated by a line with four dashes - - --- Leads -CREATE TABLE {prefix}leads ( - id INT NOT NULL AUTO_INCREMENT, - email TINYTEXT NULL, -- Email address of lead - mail_ok BOOLEAN NULL, -- OK to send them E-Mail - member_ok BOOLEAN NULL, -- OK to have members contact lead - created DATETIME NULL, -- Timestamp lead was first added - PRIMARY KEY (id), - INDEX (email(20)) -); - ----- - --- Sources - info on form or method via which lead can be submitted -CREATE TABLE {prefix}sources ( - id INT NOT NULL AUTO_INCREMENT, - title TINYTEXT NULL, -- Title/Name of source for reference - code TINYTEXT NULL, -- Code supplied by form to indicate source - form_id INT NULL, - enabled BOOLEAN NULL, - PRIMARY KEY (id), - INDEX (code(20)) -); - ----- - --- Lead Entry - Information on a single submission of lead information -CREATE TABLE {prefix}lead_entry ( - id INT NOT NULL AUTO_INCREMENT, - source_id SMALLINT NULL, -- Pointer to sources entry - Form used to submit lead data - lead_id INTEGER NULL, -- Pointer to lead - all submissions for same E-Mail address point to same leads entry - fname TINYTEXT NULL, -- First Name - lname TINYTEXT NULL, -- Last Name - org TINYTEXT NULL, -- Organization name - addr1 TINYTEXT NULL, -- Address line 1 - addr2 TINYTEXT NULL, -- Address line 2 - city TINYTEXT NULL, -- City name - state TINYTEXT NULL, -- State/Province - as submitted by Gravityforms or whatever (not state code) - zip TINYTEXT NULL, -- ZIP/Postal code - country TINYTEXT NULL, -- Country name - as submitted by form (not country code) - phone TINYTEXT NULL, -- Primary phone # - phone2 TINYTEXT NULL, -- Alternate phone # - fax TINYTEXT NULL, -- Fax # - how_heard SMALLINT NULL, -- Pointer to how_heard table entry - visit_date DATE NULL, -- Anticipated date of visit - date_submitted DATE NULL, -- Date this information was submitted - user_trace_info TINYTEXT NULL, -- User IP address and other identifying network info (pos referrer) - PRIMARY KEY (id), - INDEX (source_id), - INDEX (lead_id), - INDEX (fname(20)), - INDEX (lname(20)), - INDEX (visit_date), - INDEX (date_submitted) -); - ----- - --- Interest Groups -CREATE TABLE {prefix}interest_groups ( - id INT NOT NULL AUTO_INCREMENT, - title TINYTEXT NULL, -- Group name - members BOOLEAN DEFAULT '0', - PRIMARY KEY (id) -); - ----- - --- Interests - Used to buil Interest fields in forms - Forms use ID as value -CREATE TABLE {prefix}interests ( - id INT NOT NULL AUTO_INCREMENT, - title TINYTEXT NULL, -- Title - group_id SMALLINT NULL, -- Pointer to interest group - PRIMARY KEY (id), - INDEX (group_id) -); - ----- - --- Lead Interests - many to one links to lead-entry table -CREATE TABLE {prefix}lead_interests ( - id INT NOT NULL AUTO_INCREMENT, - interest_id SMALLINT NULL, -- Pointer to Interest table - lead_entry_id INTEGER NULL, -- Pointer to lead_entry table - PRIMARY KEY (id), - INDEX (interest_id), - INDEX (lead_entry_id) -); - ----- - --- lead_searches - Memorized search configurations -CREATE TABLE {prefix}searches ( - id INT NOT NULL AUTO_INCREMENT, - user_id INT NOT NULL, -- The wordpress user id - title TINYTEXT NULL, -- Title for this search configuration - search TEXT NULL, -- Serialized array of search parameters - date_created DATE NULL, -- Date the search type was created - PRIMARY KEY (id) -); - ----- - --- Lead Stats Date Data - Totals of lead stats for 1 day - Preserved for 2 years -CREATE TABLE {prefix}lead_stats_date ( - id INT NOT NULL AUTO_INCREMENT, - stat_date DATE NULL, -- Date for which these stats are accumulated - leads_count INTEGER NULL, -- Number of leads - PRIMARY KEY (id), - INDEX (stat_date) -); - ----- - --- Lead Stats Week Data - Totals of lead stats for 1 week - Preserved for 2 years - (generated daily?) -CREATE TABLE {prefix}lead_stats_week ( - id INT NOT NULL AUTO_INCREMENT, - stat_week DATE NULL, -- First date of week for which these stats are accumulated - leads_count INTEGER NULL, -- Number of leads - PRIMARY KEY (id), - INDEX (stat_week) -); - ----- - --- Lead Stats Month Data - Totals of lead stats for 1 month - Preserved indefinately - (generated daily?) -CREATE TABLE {prefix}lead_stats_month ( - id INT NOT NULL AUTO_INCREMENT, - stat_month DATE NULL, -- First date of month for which these stats are accumulated - leads_count INTEGER NULL, -- Number of leads - PRIMARY KEY (id), - INDEX (stat_month) -); diff --git a/setup/databaseScripts/create_database_V0.0.4.sql b/setup/databaseScripts/create_database_V0.0.4.sql new file mode 100644 index 0000000..c03cdf9 --- /dev/null +++ b/setup/databaseScripts/create_database_V0.0.4.sql @@ -0,0 +1,148 @@ +-- Gaslight Media Members Database - Leads +-- File Created: 16/07/19 16:16:16 +-- Database Version: 0.0.3 +-- Database Creation Script +-- +-- This file is called to create a new set of tables for this +-- add-on for the most receint database version for this add-on. +-- +-- There should only be one such file in this directory +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashes + + +-- Leads +CREATE TABLE {prefix}leads ( + id INT NOT NULL AUTO_INCREMENT, + email TINYTEXT NULL, -- Email address of lead + mail_ok BOOLEAN NULL, -- OK to send them E-Mail + member_ok BOOLEAN NULL, -- OK to have members contact lead + created DATETIME NULL, -- Timestamp lead was first added + PRIMARY KEY (id), + INDEX (email(20)) +); + +---- + +-- Sources - info on form or method via which lead can be submitted +CREATE TABLE {prefix}sources ( + id INT NOT NULL AUTO_INCREMENT, + title TINYTEXT NULL, -- Title/Name of source for reference + code TINYTEXT NULL, -- Code supplied by form to indicate source + form_id INT NULL, + enabled BOOLEAN NULL, + PRIMARY KEY (id), + INDEX (code(20)) +); + +---- + +-- Lead Entry - Information on a single submission of lead information +CREATE TABLE {prefix}lead_entry ( + id INT NOT NULL AUTO_INCREMENT, + source_id SMALLINT NULL, -- Pointer to sources entry - Form used to submit lead data + lead_id INTEGER NULL, -- Pointer to lead - all submissions for same E-Mail address point to same leads entry + fname TINYTEXT NULL, -- First Name + lname TINYTEXT NULL, -- Last Name + org TINYTEXT NULL, -- Organization name + addr1 TINYTEXT NULL, -- Address line 1 + addr2 TINYTEXT NULL, -- Address line 2 + city TINYTEXT NULL, -- City name + state TINYTEXT NULL, -- State/Province - as submitted by Gravityforms or whatever (not state code) + zip TINYTEXT NULL, -- ZIP/Postal code + country TINYTEXT NULL, -- Country name - as submitted by form (not country code) + phone TINYTEXT NULL, -- Primary phone # + phone2 TINYTEXT NULL, -- Alternate phone # + fax TINYTEXT NULL, -- Fax # + how_heard SMALLINT NULL, -- Pointer to how_heard table entry + visit_date DATE NULL, -- Anticipated date of visit + date_submitted DATE NULL, -- Date this information was submitted + user_trace_info TINYTEXT NULL, -- User IP address and other identifying network info (pos referrer) + PRIMARY KEY (id), + INDEX (source_id), + INDEX (lead_id), + INDEX (fname(20)), + INDEX (lname(20)), + INDEX (visit_date), + INDEX (date_submitted) +); + +---- + +-- Interest Groups +CREATE TABLE {prefix}interest_groups ( + id INT NOT NULL AUTO_INCREMENT, + title TINYTEXT NULL, -- Group name + members BOOLEAN DEFAULT '0', + PRIMARY KEY (id) +); + +---- + +-- Interests - Used to buil Interest fields in forms - Forms use ID as value +CREATE TABLE {prefix}interests ( + id INT NOT NULL AUTO_INCREMENT, + title TINYTEXT NULL, -- Title + group_id SMALLINT NULL, -- Pointer to interest group + gf_field_id TINYTEXT NULL, -- The field id from gravity forms for this interest + PRIMARY KEY (id), + INDEX (group_id) +); + +---- + +-- Lead Interests - many to one links to lead-entry table +CREATE TABLE {prefix}lead_interests ( + id INT NOT NULL AUTO_INCREMENT, + interest_id SMALLINT NULL, -- Pointer to Interest table + lead_entry_id INTEGER NULL, -- Pointer to lead_entry table + PRIMARY KEY (id), + INDEX (interest_id), + INDEX (lead_entry_id) +); + +---- + +-- lead_searches - Memorized search configurations +CREATE TABLE {prefix}searches ( + id INT NOT NULL AUTO_INCREMENT, + user_id INT NOT NULL, -- The wordpress user id + title TINYTEXT NULL, -- Title for this search configuration + search TEXT NULL, -- Serialized array of search parameters + date_created DATE NULL, -- Date the search type was created + PRIMARY KEY (id) +); + +---- + +-- Lead Stats Date Data - Totals of lead stats for 1 day - Preserved for 2 years +CREATE TABLE {prefix}lead_stats_date ( + id INT NOT NULL AUTO_INCREMENT, + stat_date DATE NULL, -- Date for which these stats are accumulated + leads_count INTEGER NULL, -- Number of leads + PRIMARY KEY (id), + INDEX (stat_date) +); + +---- + +-- Lead Stats Week Data - Totals of lead stats for 1 week - Preserved for 2 years - (generated daily?) +CREATE TABLE {prefix}lead_stats_week ( + id INT NOT NULL AUTO_INCREMENT, + stat_week DATE NULL, -- First date of week for which these stats are accumulated + leads_count INTEGER NULL, -- Number of leads + PRIMARY KEY (id), + INDEX (stat_week) +); + +---- + +-- Lead Stats Month Data - Totals of lead stats for 1 month - Preserved indefinately - (generated daily?) +CREATE TABLE {prefix}lead_stats_month ( + id INT NOT NULL AUTO_INCREMENT, + stat_month DATE NULL, -- First date of month for which these stats are accumulated + leads_count INTEGER NULL, -- Number of leads + PRIMARY KEY (id), + INDEX (stat_month) +); diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index 59de33e..3a628d2 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -17,5 +17,6 @@ $glmMembersLeadsDbVersions = array( '0.0.1' => array('version' => '0.0.1', 'tables' => 10, 'date' => '6/8/2016'), '0.0.2' => array('version' => '0.0.2', 'tables' => 10, 'date' => '7/12/2016'), '0.0.3' => array('version' => '0.0.3', 'tables' => 10, 'date' => '7/19/2016'), + '0.0.4' => array('version' => '0.0.4', 'tables' => 10, 'date' => '7/21/2016'), ); diff --git a/setup/databaseScripts/update_database_V0.0.4.sql b/setup/databaseScripts/update_database_V0.0.4.sql new file mode 100644 index 0000000..9fef881 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.4.sql @@ -0,0 +1,11 @@ +-- Gaslight Media Members Database - Events Add-On +-- File Created: 16/07/19 16:16:16 +-- Database Version: 0.0.3 +-- Database Update From Previous Version Script +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashses + + +-- Add form_id +ALTER TABLE {prefix}interests ADD COLUMN gf_field_id TINYTEXT DEFAULT NULL; diff --git a/setup/frontHooks.php b/setup/frontHooks.php index 11f24bc..a3279ed 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -133,6 +133,7 @@ add_action( 'gform_after_submission', function( $entry, $form ){ $source_id = $this->wpdb->insert_id; } $leads_fields = array(); + /* $mapped_keys = array( 'fname', 'lname', @@ -150,6 +151,8 @@ add_action( 'gform_after_submission', function( $entry, $form ){ 'mail_ok', 'member_ok', ); + */ + $mapped_keys = $this->config['mapped_keys']; // have to go through the $form array to see what field we need from post $glm_leads_entry = array(); if ( $form['fields'] ) { diff --git a/views/admin/management/leads.html b/views/admin/management/leads.html index c773042..ee107fc 100644 --- a/views/admin/management/leads.html +++ b/views/admin/management/leads.html @@ -115,6 +115,11 @@ {/if} + {if $importing} + + Next Round + + {/if} {if $import_fields} {php} echo '
' . print_r( $import_fields, true ) . '
';