if (type == 'so_num_prefix') {
		$("#so_prefix_add_block_hidden").hide('slow');
		$("#so_prefix_value_block").show('slow');
	}
}
	
function save_inventory_setting(type) {
	var setting_val = $("#"+type).val();
	var qry_string = "&type="+type+"&value="+setting_val;
	$.ajax({
		type: "POST",
		<?php 
$e_save_tax = new Event("CRMGlobalSettings->eventAjaxUpdateInventoryPrefixes");
$e_save_tax->setEventControler("/ajax_evctl.php");
$e_save_tax->setSecure(false);
?>
		url: "<?php 
echo $e_save_tax->getUrl();
?>
"+qry_string,
		beforeSubmit: function() {
			//$("#"+tax_type+"_action_"+id).html('<img src="/themes/images/ajax-loader1.gif" border="0" />');
		},
		success:  function(html) {
			$("#"+type+"_val").html(setting_val);
			cancel_inventory_setting(type);
		}
	});
}
</script>
Example #2
0
",
        data: "idcontact="+value,
        success: function(address){
           $("#invoice_address").val(address); 
        }
    });
}

function getItemSuggestion(text_id,select_id){
    var text_val = document.getElementById(text_id).value;
    $.ajax({
        type: "GET",
<?php 
$e_suggestion_item = new Event("InvoiceEditSave->eventAjaxItemSuggestion");
$e_suggestion_item->setEventControler("ajax_evctl.php");
$e_suggestion_item->setSecure(false);
?>
        url: "<?php 
echo $e_suggestion_item->getUrl();
?>
",
        data: "text="+text_val,
        success: function(item_suggestion){
            if(item_suggestion == 'No'){
                $("#"+select_id).slideUp(100);
            }else{
                $("#"+select_id).html(item_suggestion);
                if ($("#"+select_id).is(":hidden")) {
                    $("#"+select_id).slideDown(200);
                }
            }
Example #3
0
            
            
        </div>
<?php 
$import_vcard = new Event("VBook->eventVCardImport");
$import_vcard->setLevel(20);
$import_vcard->addParam("goto", "vcard_import.php");
if ($_SESSION["page_from"] == 'reg') {
    $import_vcard->addParam("fromReg", "Yes");
} else {
    $import_vcard->addParam("fromReg", "No");
}
$import_vcard->addParam("iduser", $_SESSION['do_User']->iduser);
////$import_vcard->addEventAction("ContactView->eventRebuildContactUserTable", 30);
$import_vcard->setGotFile(true);
$import_vcard->setSecure(true);
$htmlform = $import_vcard->getFormHeader();
$htmlform .= $import_vcard->getFormEvent();
$htmlform .= '<div class="import_cont3"><b>' . _('File Location: ') . '&nbsp; </b>';
$htmlform .= '<input type="file" name="fields[contact_vcard]"></div>';
$htmlform .= '<div class="import_cont3"><b>' . _('Set Tag ') . '<input type="text" name="fields[import_tag]" value="import_vCard_' . date("Y-m-d") . '">' . _(' on the imported contacts.') . '</b></div>';
$htmlform .= '<div class="import_cont3">' . $import_vcard->getFormFooter("Import") . '</div>';
$htmlform .= "\n";
echo $htmlform;
?>
    <?php 
if ($_GET['msg']) {
    echo '<div class="import_msg1">' . htmlentities($_GET['msg']) . '</div>';
}
?>
    </div>
"/>
	</div>
</div>
<script>
function del_report(idreport,report_folder,folder_name) {
	$("#report_delete_confirm").modal('show');
	$("#report_delete_confirm .btn-primary").click(function() {
		$("#report_delete_confirm").modal('hide');
		$.ajax({
			type: "POST",
			<?php 
$e_del_single = new Event("CRMDeleteEntity->eventAjaxDeleteSingleEntity");
$e_del_single->setEventControler("/ajax_evctl.php");
$e_del_single->addParam('module', $module);
$e_del_single->addParam('referrer', 'list');
$e_del_single->setSecure(false);
?>
			url: "<?php 
echo $e_del_single->getUrl();
?>
&sqrecord="+idreport,
			success:  function(html) {
				ret_data = html.trim();
				if (ret_data == '0') {
					var err_element = '<div class="alert alert-error sqcrm-top-message" id="sqcrm_auto_close_messages"><a href="#" class="close" data-dismiss="alert">&times;</a>' ;
					var err_msg = err_element+'<strong>'+UNAUTHORIZED_DELETE+'</strong></div>';
					$("#message").html(err_msg);
					$("#message").show();
				} else {
					$.ajax({
						type: "GET",
Example #5
0
			}
		});

}

function loadContacts() {
		var search_key = document.getElementById('contacts_search').value;
		var filter = document.getElementById('filter').value;
		//alert(search_key);
		$('div#last_contact_loader').html('<img src="/images/loader1.gif" alt="" />');
		$.ajax({
			type: "GET",
		<?php 
$e_contacts = new Event("do_Contacts->autoLoadContactsOnScrollDown");
$e_contacts->setEventControler("ajax_evctl.php");
$e_contacts->setSecure(false);
?>
			url: "<?php 
echo $e_contacts->getUrl();
?>
",
			data: "searchkey="+search_key+"&filter="+filter,
			success: function(data){
					$(".message_box:last").after(data);
					$('div#last_contact_loader').empty();
			}
		});

}

$(document).ready(function() {
    if (merge.selectedIndex > 0) {
        var mergefield = merge[merge.selectedIndex].value;
        var textarea = dijit.byId("editor_bodyhtml");
        textarea.attr("value", textarea.attr("value")+mergefield);
        merge.selectedIndex = 0;
    }
}

function getEmailTemplateText(template){
    var select_id = template[template.selectedIndex].value;
    $.ajax({
        type: "GET",
<?php 
$e_email_temp = new Event("do_auto_responder->eventAjaxGetEmailTemplateText");
$e_email_temp->setEventControler("ajax_evctl.php");
$e_email_temp->setSecure(false);
?>
        url: "<?php 
echo $e_email_temp->getUrl();
?>
",
        data: "temlid="+select_id,
        success: function(template_text){ 
           var textarea = dijit.byId("editor_bodyhtml");
           textarea.attr("value", template_text); 
        }
    });
}
function addAutoResponderEmail(){
     $("#ptask_ctlbar_1").slideToggle("slow");
}
Example #7
0
}
//echo $iduser_for_feed;
?>
<script type="text/javascript">
    //<![CDATA[
    function showOpt(){
        $("#more_options").hide(0);
        $("#notes_options").show("fast");
    }
    function showFullNote(idnote){
        $.ajax({
            type: "GET",
            <?php 
$e_ContactNote = new Event("ContactNoteExpend->eventAjaxGetContactNote");
$e_ContactNote->setEventControler("ajax_evctl.php");
$e_ContactNote->setSecure(false);
?>
            url: "<?php 
echo $e_ContactNote->getUrl();
?>
",
            data: "idnote="+idnote,
            success: function(notetext){
                $("#notepreview"+idnote)[0].innerHTML = notetext;
            }
        });
    }
    $(document).ready(function() {
    	$("div[id^=notetext]").hover(function(){$("div[id^=trashcan]",this).show("fast");},function(){$("div[id^=trashcan]",this).hide("fast");});
    });
    //]]>
	$("#<?php 
    echo $fielddisp . '_' . $field;
    ?>
").attr('value',values[1]);
	$("#<?php 
    echo $field;
    ?>
").attr('value',values[0]);
	if (confirm('Do you want to copy the contact address ?')) {
		var qry_string = "&id="+return_data;
		$.ajax({
			type: "GET",
			<?php 
    $e_org = new Event("Contacts->eventGetContactsAddress");
    $e_org->setEventControler("/ajax_evctl.php");
    $e_org->setSecure(false);
    ?>
			url: "<?php 
    echo $e_org->getUrl();
    ?>
"+qry_string,
			success:  function(html) {
				obj = JSON.parse(html);
				var pk = obj.id;
				if (pk > 0) {
					var field_prefix = '';
					if (target_module == 'PurchaseOrder') {
						field_prefix = 'po_';
					}
					$("#"+field_prefix+"billing_address").html(obj.cnt_mail_street);
					$("#"+field_prefix+"billing_po_box").attr('value',obj.cnt_mail_pobox);
Example #9
0
        document.location.href = "/task.php?idprojecttask="+idproject_task;
    }
    function showDateOpt(){
        $("#due_sp_date").show(0);
        $("#when_due").hide(0);
        document.getElementById('sp_date_selected').value = "Yes";
    }
    function hideDateOpt(){
        $("#due_sp_date").hide(0);
        $("#when_due").show(0);
        document.getElementById('sp_date_selected').value = "";
    }
<?php 
$e_PrioritySort = new Event("ProjectTask->eventAjaxPrioritySort");
$e_PrioritySort->setEventControler("ajax_evctl.php");
$e_PrioritySort->setSecure(false);
$strPrioritySortURL = $e_PrioritySort->getUrl();
?>
    function moveTasks(TorB) {
        var priorities="",checked="",unchecked="";
        var priorities=$("#project_tasks").sortable("toArray");
        $("input:checkbox").each(function(){
            if(this.checked){
                checked+=(checked=="")?"":"&";
                checked+="pt[]="+$(this).parents("li").attr("id").substr(3);
            }else{
                unchecked+=(unchecked=="")?"":"&";
                unchecked+="pt[]="+$(this).parents("li").attr("id").substr(3);
            }
        });
        if(TorB==1){
Example #10
0
echo $e_editForm->getUrl();
?>
",
            data: "idtag_delete="+idtag,
            success: function(){
                $("#"+iddom).remove();
            }
        });
    }
    $(document).ready(function() {
        $.ajax({
            type: "GET",
<?php 
$e_EventKey = new Event("EventKey->eventAjaxGetEventKey");
$e_EventKey->setEventControler("ajax_evctl.php");
$e_EventKey->setSecure(false);
?>
            url: "<?php 
echo $e_EventKey->getUrl();
?>
",
            success: function(key){
                EventKey = key;
            }
        });
    	$("div[id^=notetext]").hover(function(){$("div[id^=trashcan]",this).show("fast");},function(){$("div[id^=trashcan]",this).hide("fast");});
    });
    //]]>
</script>

<div class="mobile_main main">
Example #11
0
echo _('Total');
?>
</th>
                        <th>&nbsp;</th>
                    </tr>
                    <?php 
echo $_SESSION['InvoiceLine']->getNewFormFields(1);
?>
                </table>
                <a href="#" id="addOneMore"><?php 
echo _('Add another');
?>
</a>
                <?php 
$e_addform = new Event($_SESSION['InvoiceLine']->getInvoiceLinePrefix() . "->eventAjaxInvoiceFormEntry");
$e_addform->setSecure(false);
$e_addform->setEventControler("ajax_evctl.php");
?>
                <script type="text/javascript">
                    var InvoiceLineCount = 2;
                    $("#addOneMore").click(function(){
                        $.get("<?php 
echo $e_addform->getUrl();
?>
&count="+InvoiceLineCount++, function(data){$("#invoice_list").append(data);});
                        return false;
                    }); 
                </script>
                <div class="invoice_edit_totals">
                    <table class="invoice_edit_totals_table" onclick="reCalculateAmount();">
                        <tr>
Example #12
0
$do_contact = new Contact($GLOBALS['conx']);
$do_notes = new ContactNotes($GLOBALS['conx']);
$do_company = new Company($GLOBALS['conx']);
?>
<script type="text/javascript">
    //<![CDATA[
    function showOpt(){
        $("#notes_options").show(0);
    }
    function showFullNote(idnote){
        $.ajax({
            type: "GET",
<?php 
$e_CompanyNote = new Event("ContactNotes->eventAjaxGetCompanyNote");
$e_CompanyNote->setEventControler("ajax_evctl.php");
$e_CompanyNote->setSecure(false);
?>
            url: "<?php 
echo $e_CompanyNote->getUrl();
?>
",
            data: "idnote="+idnote,
            success: function(notetext){
                $("#notepreview"+idnote)[0].innerHTML = notetext;
            }
        });
    }
    $(document).ready(function() {
    	$("div[id^=notetext]").hover(function(){$("div[id^=trashcan]",this).show("fast");},function(){$("div[id^=trashcan]",this).hide("fast");});
    });
    //]]>
Example #13
0
			$("#"+tbody_id).append('<tr id="'+tax_type+'_'+pk+'"><td id="'+tax_type+'_tax_name_'+pk+'">'+tax_name_val+'</td><td id="'+tax_type+'_tax_value_'+pk+'">'+tax_value_val+' %</td><td id="'+tax_type+'_action_'+pk+'"><a href="#" class="btn btn-primary btn-xs" onclick="edit_tax_inline_form(\''+pk+'\',\''+tax_type+'\')"><i class="glyphicon glyphicon-edit"></i></a>&nbsp;<a href="#" class="btn btn-primary btn-xs" onclick="return_delete_tax_confirm(\''+pk+'\',\''+tax_type+'\')"><i class="glyphicon glyphicon-trash"></i></a></td></tr>');
			var add_block = tax_type+'_add_block';
			var add_block_hidden = tax_type+'_add_block_hidden';
			$('#'+add_block_hidden).hide("slow");
			$('#'+add_block).show("slow");
		}
	});
}
  
function return_delete_tax_confirm(id,tax_type) {
	$("#delete_confirm_tax").modal('show');
	$("#delete_confirm_tax .btn-primary").off('click');
	$("#delete_confirm_tax .btn-primary").click(function() {
		$("#delete_confirm_tax").modal('hide');
		var qry_string = "&tax_type="+tax_type+"&id="+id;
		$.ajax({
			type: "POST",
			<?php
			$e_del_tax = new Event("TaxSettings->eventDeleteTaxData");
			$e_del_tax->setEventControler("/ajax_evctl.php");
			$e_del_tax->setSecure(false);
			?>
			url: "<?php echo $e_del_tax->getUrl(); ?>"+qry_string,
			success:  function(html) {
				var tr_id = tax_type+'_'+id ;
				$("#"+tr_id).remove();
			}
		});
	});
}
</script>
Example #14
0
 /**
  * Getuser tag list, display all the tags of a user 
  * with a link to generate a search and if search exists cumulate tags
  * to narrow further a search.
  * Currently this method is only for the contacts as it uses the do_Contacts object
  */
 function getUserTagList($reference_type = "")
 {
     if (isset($_SESSION['last_tag_refresh'])) {
         if ($_SESSION['last_tag_refresh'] < time() - 60) {
             $_SESSION['last_tag_refresh'] = time();
             $this->calculateTagSize();
         }
     } else {
         $_SESSION['last_tag_refresh'] = time();
         $this->calculateTagSize();
     }
     if ($_SESSION['tag_refresh_now']) {
         $this->calculateTagSize();
         $_SESSION['tag_refresh_now'] = false;
     } else {
         $_SESSION['tag_refresh_now'] = false;
     }
     if ($_SESSION['do_User']->getIsMobile()) {
         $mobile = 'Yes';
     }
     $this->setLog("\n Tag list generation:\n-----------------------");
     $this->setLog("\n last tag refresh:" . $_SESSION['last_tag_refresh'] . " Current time: " . time() . " is time refresh now ?:" . (string) $_SESSION['tag_refresh_now'] . "\n");
     $do_tags = new Tag($this->getDbCon());
     $e = new Event("do_Contacts->eventSearchByTag");
     $e->setSecure(false);
     if ($mobile == 'Yes') {
         $e->addParam("goto", "i_contacts.php");
     } else {
         $e->addParam("goto", "contacts.php");
     }
     $do_tags->query("SELECT tag_name, clicks FROM tag_size WHERE iduser="******" ORDER BY tag_name");
     while ($do_tags->next()) {
         $e->addParam("search_tag_name", $do_tags->tag_name);
         if (!empty($html)) {
             $html .= ', ';
         }
         $html .= "\n" . '<a href="' . $e->getUrl() . '" class="tag_link" style="font-size:' . $do_tags->clicks . 'px;">' . $do_tags->tag_name . '</a>';
     }
     return $html;
 }
<script type="text/javascript" src="jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
  $('#btnSubmit').click(function() {
    var username = $.trim($('#username').val());
    var pwd = $.trim($('#password').val());
    //Blank validation
    if(username != '' && pwd != '') {
	//An ajax call to add user's LeanKit Kanban login credentials.
        $.ajax({
            type: "GET",
        <?php 
$e = new Event("OfuzLeanKitKanban->eventAjaxAddLoginCredentials");
$e->setEventControler("ajax_evctl.php");
$e->setSecure(false);
?>
            url: "<?php 
echo $e->getUrl();
?>
",
            data: "un="+username+"&pwd="+pwd,
            success: function(response){
	      $('#msg').html(response);
	      $('#msg').slideDown('slow');
            }
        });
    } else {
      $('#msg').html('Your Email Address and Password are required.');
      $('#msg').slideDown('slow');
    }
  });
Example #16
0
 function getNewFormFields($new_invoice_line_count)
 {
     $invoice_form = '<tr id="' . $this->getInvoiceLinePrefix() . $new_invoice_line_count . '" onclick="reCalculateAmount();">';
     $invoice_form .= '<td colspan="2"><input type="text" style="width: 90%" size="20" name="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][item]" value="" id="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][item]" onkeyup=\'getItemSuggestion("mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][item]","suggestion_area_item' . $new_invoice_line_count . '")\' autocomplete="off" />';
     $invoice_form .= '<select id="suggestion_area_item' . $new_invoice_line_count . '" size="5" style="border: solid 1px #b3b3b3; position: absolute; z-index: 2;display:none;" onchange=\'setItemSuggestion("this.options[this.selectedIndex].text","mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][item]","suggestion_area_item' . $new_invoice_line_count . '")\' ></select>';
     /*
     // Description below the item, but on the same row
     $invoice_form .= '<br />'._('Description').'<br /><textarea cols="20" rows="2" name="mfields['.$this->getTable().'_new]['.$new_invoice_line_count.'][description]" id="mfields['.$this->getTable().'_new]['.$new_invoice_line_count.'][description]" style="width:90%;"></textarea>';
     $invoice_form .= '<script type="text/javascript">
                  $(document).ready(function() {
                      $(document.getElementById("mfields['.$this->getTable().'_new]['.$new_invoice_line_count.'][description]")).expandable();
                  });
                   </script>
                  '."\n";
     */
     $invoice_form .= '<input type="hidden" size="10" name="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][total]" value="" id="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][total]" readonly="readonly" />
     <input type="hidden" size="10" name="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][total_with_discount]" value="" id="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][total_with_discount]" readonly="readonly" />
     <input type="hidden" size="10" name="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][discounted_amount]" value="" id="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][discounted_amount]" readonly="readonly" />
     <input type="hidden" size="10" name="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][taxed_amount]" value="" id="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][taxed_amount]" readonly="readonly" /></td>';
     /*
     // Description in column 2
     $invoice_form .= '<td><textarea cols="10" rows="2" name="mfields['.$this->getTable().'_new]['.$new_invoice_line_count.'][description]" id="mfields['.$this->getTable().'_new]['.$new_invoice_line_count.'][description]" style="width:90%;"></textarea>';
     $invoice_form .= '<script type="text/javascript">
                  $(document).ready(function() {
                      $(document.getElementById("mfields['.$this->getTable().'_new]['.$new_invoice_line_count.'][description]")).expandable();
                  });
                   </script></td>
                  '."\n";
     */
     $invoice_form .= '<td class="center_text"><input type="text" size="5" name="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][qty]" value="" id="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][qty]" onchange=\'computeTotal()\' /></td>';
     $invoice_form .= '<td><input type="text" size="10" name="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][price]" id="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][price]" value="" onchange=\'computeTotal()\' /></td>';
     $invoice_form .= '<td ><input type="text" size="4" class="center_text" name="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][line_tax]" id="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][line_tax]" value="" onchange=\'computeTotal()\' /></td>';
     //$invoice_form .= '<td><input type="hidden" size="10" name="mfields['.$this->getTable().'_new]['.$new_invoice_line_count.'][total]" value="" id="mfields['.$this->getTable().'_new]['.$new_invoice_line_count.'][total]" readonly="readonly" /></td>';
     $invoice_form .= '<td><input type="text" size="10" name="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][line_sub_total]" value="" id="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][line_sub_total]" readonly="readonly" /></td>';
     $e_delForm = new Event($this->getInvoiceLinePrefix() . "->eventAjaxInvoiceLineDelete");
     $e_delForm->addParam("id", $this->getPrimaryKeyValue());
     $e_delForm->setSecure(false);
     $e_delForm->setEventControler("ajax_evctl.php");
     $invoice_form .= '<td><a href="#" id="delete' . $this->getInvoiceLinePrefix() . $new_invoice_line_count . '" title="' . _('Delete this item') . '"><img src="/images/delete.gif" alt="" /></a>';
     $invoice_form .= '
         <script type="text/javascript">
             $("#delete' . $this->getInvoiceLinePrefix() . $new_invoice_line_count . '").click(
                 function () {
                     $.get("' . $e_delForm->getUrl() . '");
                     $("#' . $this->getInvoiceLinePrefix() . $new_invoice_line_count . '").hide(1000).empty();
                     $("#' . $this->getInvoiceLinePrefix() . $new_invoice_line_count . '_dscr").hide(1000).empty();
                     return false;
                 }); 
         </script>';
     $invoice_form .= '</td></tr>';
     // Description on a new row
     $invoice_form .= '<tr id="' . $this->getInvoiceLinePrefix() . $new_invoice_line_count . '_dscr" class="invoice_edit_list_desc"><td colspan="5">&nbsp; &nbsp; <span class="gray_text">' . _('Item Description') . '</span><br /><textarea cols="20" rows="2" name="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][description]" id="mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][description]" style="width:90%;"></textarea>';
     $invoice_form .= '<script type="text/javascript">
                  $(document).ready(function() {
                      $(document.getElementById("mfields[' . $this->getTable() . '_new][' . $new_invoice_line_count . '][description]")).expandable();
                  });
                   </script></td><td colspan="2">&nbsp;</td></tr>' . "\n";
     return $invoice_form;
 }
"/>
	</div>
</div>
<script>

function delete_custom_field(idmodule,idfields) {
	$("#delete_confirm").modal('show');
	$("#delete_confirm .btn-primary").click(function() {
		$("#delete_confirm").modal('hide');
		$.ajax({
			type: "POST",
			<?php 
$e_del = new Event("CustomFields->eventAjaxDeleteCustomField");
$e_del->setEventControler("/ajax_evctl.php");
$e_del->addParam('idmodule', $cf_module);
$e_del->setSecure(false);
?>
			url: "<?php 
echo $e_del->getUrl();
?>
&idfields="+idfields,
			success:  function(html) {
				ret_data = html.trim();
				if (ret_data == '0') {
					var err_element = '<div class="alert alert-error sqcrm-top-message" id="sqcrm_auto_close_messages"><a href="#" class="close" data-dismiss="alert">&times;</a>' ;
					var err_msg = err_element+'<strong>'+CUSTOM_FIELD_DELETE_NOT_ALLOWED+'</strong></div>';
					$("#message").html(err_msg);
					$("#message").show();
				} else {
					$.ajax({ 
						type: "GET",
Example #18
0
<?php 
// Copyright SQCRM. For licensing, reuse, modification and distribution see license.txt 

/**
* breadcrumb view  
* @author Abhik Chakraborty
*/  
          
?>
<div id="breadcrumb_loader"></div>
<script>
$(document).ready(function() {
  $.ajax({
    type: "GET",
    <?php
      $e_load_breadcrumb = new Event("CRMEntityRecentlyViewed->eventAjaxLoadRecentlyViewed");
      $e_load_breadcrumb->setEventControler("/ajax_evctl.php");
      $e_load_breadcrumb->setSecure(false);
    ?>
    url: "<?php echo $e_load_breadcrumb->getUrl(); ?>",
    beforeSubmit: function() {
     $('#breadcrumb_loader').html('<img src="/themes/images/ajax-loader1.gif" border="0" />');
    },
    success:  function(html) {
     $('#breadcrumb_loader').html(html);
    }
  });
});
</script>
Example #19
0
		if (groupId == '0') {
			display_js_error(PLUGIN_SWU_SELECT_A_GROUP,'message');
			return false;
		}
		
		var formData = {
			"templateId":templateId,
			"groupId":groupId
		};
		
		$.ajax({
			type: "POST",
			<?php 
$e_event = new Event("EmailerSendWithUs->eventSendEmailToGroupWithTemplate");
$e_event->setEventControler("/ajax_evctl.php");
$e_event->setSecure(false);
?>
			url: "<?php 
echo $e_event->getUrl();
?>
",
			data: formData,
			beforeSubmit: function() {
			
			},
			success: function(res) {
				if (res.trim() == '1') {
					display_js_success(PLUGIN_SWU_EMAIL_SENT_TO_GROUP_WITH_TEMPLATE,'message');
				} else {
					display_js_error(res,'message');
				}
Example #20
0
/*
* function to delete the note.
* use ajax eventcontroler
*/
function delete_notes(idnotes) {
	var notes_content_id = 'content_'+idnotes;
	var current_note = $("#"+notes_content_id).html();
	$("#delete_entity_notes").modal('show');
	$("#entiry_notes").on('click','.delete_entity_note_submit', function(e) {
		$('#'+notes_content_id).html('<img src="/themes/images/ajax-loader1.gif" border="0" />');
		$.ajax({
			type: "GET",
			<?php
			$e_del_notes = new Event("Notes->eventAjaxDeleteNotes");
			$e_del_notes->setEventControler("/ajax_evctl.php");
			$e_del_notes->setSecure(false);
			?>
			url: "<?php echo $e_del_notes->getUrl(); ?>&idnotes="+idnotes,
			success:  function(html) {
				var ret_data = html.trim();
				if(ret_data == '0') {
					var succ_element = '<div class="alert alert-danger sqcrm-top-message" id="sqcrm_auto_close_messages"><a href="#" class="close" data-dismiss="alert">&times;</a>' ;
					var succ_msg = succ_element+'<strong>'+UNAUTHORIZED_DELETE+'</strong></div>';
					$("#message").html(succ_msg);
					$("#message").show();
					$('#'+notes_content_id).html(current_note);
				} else {
					$('#note'+idnotes).remove();
					$('#note_separator_'+idnotes).remove();
					var succ_element = '<div class="alert alert-success sqcrm-top-message" id="sqcrm_auto_close_messages"><a href="#" class="close" data-dismiss="alert">&times;</a>' ;
					var succ_msg = succ_element+'<strong>'+NOTES_DELETED_SUCCESSFULLY+'</strong></div>';
Example #21
0
//      }); 
//     });
  </script>
<div class="loginbg1">
    <div class="loginheader"><a href="/index.php"><img src="/images/ofuz_logo2.jpg" width="170" height="90" alt="" /></a></div>
    <div class="loginbg2">
    <?php 
//echo $_SESSION['do_ofuz_fb']->fb_uid;exit;
$loginForm = new User();
$loginForm->sessionPersistent("do_User", "", 36000);
if ($_SESSION['do_ofuz_fb']->fb_uid != 0 && $_SESSION['do_ofuz_fb']->fb_uid != "" && is_object($_SESSION['do_ofuz_fb'])) {
    $evctl = new Event("do_User->eventLoginFb");
    $evctl->addParam("fbuid", $_SESSION['do_ofuz_fb']->fb_uid);
    $evctl->addParam("errPage", "fb_ofuz_login_verification.php");
    $evctl->addParam("nextPage", "index.php");
    $evctl->setSecure(true);
    ?>
<script type="text/javascript">
//<![CDATA[
window.location.href = "<?php 
    echo $evctl->getUrl();
    ?>
";
//]]>
</script>
<?php 
}
if ($_GET['message']) {
    $message = new Message();
    $message->setContent($_GET['message']);
    $message->displayMessage();
Example #22
0
$do_sync = new Sync($GLOBALS['conx']);
if (isset($_GET['ref']) && $_GET['ref'] == 'reg') {
    $ref = $_GET['ref'];
    $_SESSION["page_from"] = $ref;
}
?>
 <link rel="stylesheet" type="text/css" href="/includes/ofuzcom_theme.css" /> 
<script type="text/javascript">
    //<![CDATA[
    function fnEnterEmail(ref, act) {
        $.ajax({
            type: "GET",
<?php 
$e_emailForm = new Event("Sync->eventAjaxEnterEmailForm");
$e_emailForm->setEventControler("ajax_evctl.php");
$e_emailForm->setSecure(false);
?>
            url: "<?php 
echo $e_emailForm->getUrl();
?>
",
            data: "referrer="+ref+"&act="+act,
            success: function(html){
                $("#instruction"+ref+act).slideToggle("slow");

                $("#"+ref+act)[0].innerHTML = html;
                $("#"+ref+act).toggle(0);
            }
        });
    }
    //]]>
Example #23
0
	var idteam_users;
	var values = new Array();
	
	idteam_users = $('#idteam_users').val();
	$.each($("input[name='coworker']:checked"), function() {
	  values.push($(this).val());
	});	

	if(values.length > 0) {
		$.ajax({
			type: "GET",
			<?php 
$e_cw = new Event("Teams->eventAjaxAddCoWorkerToTeam");
$e_cw->setEventControler("ajax_evctl.php");
$e_cw->setSecure(false);
?>
			url: "<?php 
echo $e_cw->getUrl();
?>
",
			data: "idcoworker="+values+"&idteam_users="+idteam_users,
			success: function(response){
				if(response != "") {
					$("#OfuzSuccessMessage").show('slow');
					$('#OfuzSuccessMessage')[0].innerHTML = "The CoWorker/s added to the Team.";
					$("#DivCreateNewTeam")[0].innerHTML = response;
				}
			}
		});	
	} else {
Example #24
0
function submitImportForm() {
  document.getElementById('loader').style.display = 'block';
  document.getElementById('RestoreAccount__eventImportAccount').submit();
  document.getElementById('loader').style.display = '';
}
</script>
<div class="import_cont3" id="loader" style="display:none;"><img src="/images/ajax-loader1.gif" border="0" /></div>
<?php 
include_once "config.php";
ini_set('max_execution_time', 300);
//300 seconds = 5 minutes
if ($_SESSION['in_page_message'] != "") {
    echo '<div class="import_cont3"><b>' . $_SESSION['in_page_message'] . '</b></div>';
}
$import_xml = new Event("RestoreAccount->eventImportAccount");
$import_xml->addParam("goto", $_SERVER["PHP_SELF"]);
$import_xml->setGotFile(true);
$import_xml->setSecure(true);
$htmlform = $import_xml->getFormHeader();
$htmlform .= $import_xml->getFormEvent();
$htmlform .= '<div class="import_cont3"><b>File Location: &nbsp; </b>';
$htmlform .= '<input type="file" name="fields[import_account]">';
//$htmlform .= $import_xml->getFormFooter("Import").'</div>';
$htmlform .= '<input type="button" name="button" value="Import" onclick="javascript:submitImportForm();"/>';
$htmlform .= '</form></div>';
$htmlform .= "\n";
echo $htmlform;
$_SESSION['in_page_message'] = "";
?>

Example #25
0
  var textcontent =   document.getElementById('draft_hidden').value ;
  var msg_sub = document.getElementById('draft_subject_hidden').value ;
  var textarea = dijit.byId("editor_bodyhtml");
  textarea.attr("value", textcontent);
  $("input[name='fields[subject]']").val(msg_sub) ;
   $("#unsaved_draft").hide("slow");
  
}
// Discard the saved draft
function discardDraft(id){
    $.ajax({
        type: "GET",
        <?php 
$e_MessageDraft = new Event("do_message_draft->eventDeleteDraft");
$e_MessageDraft->setEventControler("ajax_evctl.php");
$e_MessageDraft->setSecure(false);
?>
        url: "<?php 
echo $e_MessageDraft->getUrl();
?>
",
        data: "id="+id,
        success: function(result){
             $("#unsaved_draft").hide("slow");
        }
    });
}
// Run the save draft method in every 30 seconds
window.setInterval("fnSaveDraft()", 30000);

$(document).ready(function() {;
Example #26
0
 function formMultiEntry()
 {
     if ($this->getNumRows() > 0) {
         while ($this->next()) {
             $phone_form .= '<script type="text/javascript">
                         //<![CDATA[
                         var new_' . $this->getPrefix() . '_count=1;
                         //]]>
                         </script>';
             $phone_form .= '<div id="edit' . $this->getPrefix() . $this->getPrimaryKeyValue() . '">';
             $phone_form .= $this->getUpdateFormFields();
             $e_delPhone = new Event($this->getPrefix() . "->eventAjaxDelete");
             $e_delPhone->addParam("id", $this->getPrimaryKeyValue());
             $e_delPhone->setSecure(false);
             $e_delPhone->setEventControler("ajax_evctl.php");
             $phone_form .= '<a href="#" id="delete' . $this->getPrefix() . $this->getPrimaryKeyValue() . '" title="' . _('Delete this fields') . '"><img src="images/delete.gif"></a></div>';
             $phone_form .= '<script type="text/javascript">
                         //<![CDATA[
                         $("#delete' . $this->getPrefix() . $this->getPrimaryKeyValue() . '").click(
                             function () {
                             $.get("' . $e_delPhone->getUrl() . '");
                             $("#edit' . $this->getPrefix() . $this->getPrimaryKeyValue() . '").hide(1000).empty();
                             return false;
                             }
                         );
                         //]]>
                         </script>';
             $phone_form .= '<div class="spacerblock_2"></div>';
         }
         $phone_form .= '<div id="ListNew' . $this->getPrefix() . '"></div>';
         $phone_form .= '<a href="#" id="addOneMore' . $this->getPrefix() . '">' . _('Add another') . '</a>';
         $e_addform = new Event($this->getPrefix() . "->eventAjaxFormEntry");
         $e_addform->setEventControler("ajax_evctl.php");
         $e_addform->setSecure(false);
         $phone_form .= '
         <script type="text/javascript">
         //<![CDATA[
             $("#addOneMore' . $this->getPrefix() . '").click(function () {
                 new_' . $this->getPrefix() . '_count++;
                 $("#ListNew' . $this->getPrefix() . '").append(\'<div id="new' . $this->getPrefix() . '\'+new_' . $this->getPrefix() . '_count+\'" style="margin-bottom:2px;display:none"></div>\');                    
                 $("#new' . $this->getPrefix() . '"+new_' . $this->getPrefix() . '_count).load("' . $e_addform->getUrl() . '&count="+new_' . $this->getPrefix() . '_count, function(){$(this).slideDown(200);});
                 return false;
             });
         //]]>
         </script>';
         return $phone_form;
     } else {
         $this->setLog("\n (" . $this->getPrefix() . ") Multiline form with no data");
         $phone_form .= '<script type="text/javascript">
                    //<![CDATA[
                    var new_' . $this->getPrefix() . '_count=2;
                    //]]>
                    </script>';
         $phone_form .= '<div id="ListNew' . $this->getPrefix() . '">';
         $new_phone_count = 1;
         $phone_form .= '
     <div id="new' . $this->getPrefix() . 'C' . $new_phone_count . '">';
         $phone_form .= $this->getNewFormFields($new_phone_count);
         $phone_form .= '<a href="#" id="deleteAdd' . $this->getPrefix() . $new_phone_count . '" title="' . _('Delete this field') . '">
         <img src="images/delete.gif">
     </a>
     </div>
     <script type="text/javascript">
     //<![CDATA[
         $("#deleteAdd' . $this->getPrefix() . $new_phone_count . '").click( function () { 
             $("#new' . $this->getPrefix() . 'C' . $new_phone_count . '").hide(1000).empty();
             return false;
         });
     //]]>
     </script>
     ';
         $phone_form .= '<div class="spacerblock_2"></div></div>';
         $phone_form .= '<a href="#" id="addOneMore' . $this->getPrefix() . '">' . _('Add another') . '</a>';
         $e_addform = new Event($this->getPrefix() . "->eventAjaxFormEntry");
         $e_addform->setEventControler("ajax_evctl.php");
         $e_addform->setSecure(false);
         $phone_form .= '
         <script type="text/javascript">
         //<![CDATA[
             $("#addOneMore' . $this->getPrefix() . '").click(function () {
                 new_' . $this->getPrefix() . '_count++;
                 $("#ListNew' . $this->getPrefix() . '").append(\'<div id="new' . $this->getPrefix() . '\'+new_' . $this->getPrefix() . '_count+\'" style="margin-bottom:2px;display:none"></div>\');                    
                 $("#new' . $this->getPrefix() . '"+new_' . $this->getPrefix() . '_count).load("' . $e_addform->getUrl() . '&count="+new_' . $this->getPrefix() . '_count, function(){$(this).slideDown(200);});
                 return false;
             });
         //]]>
         </script>';
         return $phone_form;
     }
 }
Example #27
0
        success: function(hide_inv){ 
        }
    });
}

function showExtraAmt(){
  $("#extra_amt").slideToggle("slow");
}

function showPastDue(){
    $.ajax({
        type: "GET",
<?php 
$e_show_past_due = new Event("do_invoice_list->eventShowPastDue");
$e_show_past_due->setEventControler("ajax_evctl.php");
$e_show_past_due->setSecure(false);
?>
        url: "<?php 
echo $e_show_past_due->getUrl();
?>
",
        data: "a=1",
        success: function(html_data){ 
           $("#past_due_txt").hide("fast");
           $("#inv_msgs").hide("fast");
           $("#show_past_due")[0].innerHTML = html_data;
        }
    });
}

//]]>
Example #28
0
<?php

/** Ofuz Open Source version is released under the GNU Affero General Public License, please read the full license at: http://www.gnu.org/licenses/agpl-3.0.html **/
// Copyright 2008 - 2010 all rights reserved, SQLFusion LLC, info@sqlfusion.com
/** Ofuz Open Source version is released under the GNU Affero General Public License, please read the full license at: http://www.gnu.org/licenses/agpl-3.0.html **/
?>
// JS functions from includes/ofuz_js.inc.php

// close message hide is and record it on the server.
	<?php 
$e_closeMessage = new Event("Message->eventAjaxCloseMessage");
$e_closeMessage->setEventControler("ajax_evctl.php");
$e_closeMessage->setSecure(false);
?>
    function close_message(idmessage) {
			$.ajax({
            type: "GET",
            url: "<?php 
echo $e_closeMessage->getUrl();
?>
",
            data: "idmessage="+idmessage,
            success: function(){
            	$("#message_"+idmessage).fadeOut("slow");
            }
        });
    }
Example #29
0
                $("#e"+task).show(0);
            }
        });
    };
    function fnCancelEdit(task) {
        $("#e"+task).hide(0);
        $("#e"+task)[0].innerHTML = "";
        $("#t"+task).show(0);
    };
    function fnTaskComplete(task) {
        $.ajax({
            type: "GET",
<?php 
$e_editForm = new Event("Task->eventAjaxTaskComplete");
$e_editForm->setEventControler("ajax_evctl.php");
$e_editForm->setSecure(false);
?>
            url: "<?php 
echo $e_editForm->getUrl();
?>
",
            data: "id="+task,
            success: function(){
            	$("#t"+task).css("text-decoration", "line-through");
            	$("#t"+task).fadeOut("slow", function() {
            	    $("#e"+task).remove();
            	    $("#b"+task).remove();
                });
            }
        });
    };
Example #30
0
               *
               */ 
	      bindSorting();
	      $("#tasks_options_this_month").hide();
	  }
      });

  }

  function showAllTasksOverdue(){
      $.ajax({
	  type: "GET",
	  <?php 
$e_task_overdue = new Event("Task->eventAjaxGetAllTasksOverdue");
$e_task_overdue->setEventControler("ajax_evctl.php");
$e_task_overdue->setSecure(false);
?>
	  url: "<?php 
echo $e_task_overdue->getUrl();
?>
",
	  data: "",
	  success: function(tasks_overdue){		 
	      $("#tasks_overdue")[0].innerHTML = tasks_overdue;

	      /* 
	       * After ajax call, jquery's $(document).ready or events no longer work after you've loaded new 
                 content into a page using an AJAX request.
                 There are different ways of handling this like : event delegation and event rebinding.
                 bindSorting() is kind of rebinding.
               * @see  http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F