Ejemplo n.º 1
0
                <?php 
if (is_object($GLOBALS['cfg_submenu_placement']['index'])) {
    echo $GLOBALS['cfg_submenu_placement']['index']->getMenu();
}
?>
        </div>
        
        
        <script type="text/javascript">
        function autoLoadWorkfeed() {
                $('div#last_feed_loader').html('<img src="/images/loader1.gif">');
                $.ajax({
                    type: "GET",
                <?php 
$e_workfeed = new Event("do_work_feed->autoLoadWorkfeedOnScrollDown");
$e_workfeed->setEventControler("ajax_evctl.php");
$e_workfeed->setSecure(false);
?>
                    url: "<?php 
echo $e_workfeed->getUrl();
?>
",
                    //data: "dob="+dob,
                    success: function(data){
                            $(".message_box:last").after(data);
                            $('div#last_feed_loader').empty();
                    }
                });
                
        }
        
Ejemplo n.º 2
0
function copyDraft(){
  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);
Ejemplo n.º 3
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;
        }
    });
}
Ejemplo n.º 4
0
    $added_by_contact = 'Yes';
}
//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");});
    });
Ejemplo n.º 5
0
function addCoWorkerToTeam(){

	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;
				}
			}
		});	
Ejemplo n.º 6
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");
            }
        });
    }
function fnInsertMergeField(merge){
    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");
	}
	
	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);
		}
	});
}
Ejemplo n.º 9
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>
Ejemplo n.º 10
0
?>
",
        data: "idproject="+idproject,
        success: function(result){
             $("#cp_prj_tasks")[0].innerHTML = result;
        }
    });
}

function autoLoadContactNotes() {
		$('div#last_note_loader').html('<img src="/images/loader1.gif">');
		$.ajax({
			type: "GET",
		<?php 
$e_notes = new Event("ContactNotes->autoLoadNotesOnScrollDown");
$e_notes->setEventControler("ajax_evctl.php");
$e_notes->setSecure(false);
?>
			url: "<?php 
echo $e_notes->getUrl();
?>
",
			//data: "dob="+dob,
			success: function(data){
					$(".message_box:last").after(data);
					$('div#last_note_loader').empty();
			}
		});
		
}
Ejemplo n.º 11
0
               * @see  http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F
               *
               */ 
	      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.
Ejemplo n.º 12
0
			$("#save_import_map_section").hide();
		} else {
			$("#save_import_map_section").show();
		}
    });
    
    // when the saved map value is changed the data is loaded and set the map selection options
    $("#use_saved_map").change( function() {
		var saved_map_id = $(this).val();
		if (saved_map_id > 0) {
			$("#delete_saved_map_section").show();
			$.ajax({
				type: "GET",
				<?php
				$e_load_maps = new Event("do_import->eventLoadSavedMaps");
				$e_load_maps->setEventControler("/ajax_evctl.php");
				$e_load_maps->addParam("import_module_id",$import_module_id);
				$e_load_maps->setSecure(false);
				?>
				datatype:"json",
				url: "<?php echo $e_load_maps->getUrl(); ?>&id="+saved_map_id,
				beforeSubmit: function() {
					// $("#load_more_notes_btn").html(LOADING);
					// $("#load_more_notes_btn").attr('disabled','disabled');
				},
				success:  function(html) {
					if (html == 0) {
						display_js_error(IMPORT_SAVED_MAP_NOT_FOUND,'js_errors');
					} else {
						var mapped_data = html;
						$.each(mapped_data,function(index,value) {
Ejemplo n.º 13
0
    function createFeedbackBox()
    {
        $e_SendFeedback = new Event("Feedback->eventAjaxSendFeedback");
        $e_SendFeedback->setEventControler("ajax_evctl.php");
        $e_SendFeedback->setSecure(false);
        $strURL = $e_SendFeedback->getUrl();
        echo <<<HTML
        <div id="feedback_box">
            <script type="text/javascript">
            //<![CDATA[
            \$(document).ready(function(){
            \$("#feedback_button").click(function(){
                if(\$("#feedback_box").css("left")!="-300px"){
                feedback_close();
                }else{
                \$("#feedback_box").animate({left:"0"},500);
                \$("#feedback_text").focus();
                }
            });});
            function feedback_close(){
                \$("#feedback_box").animate({left:"-300px"},500);
                \$("#feedback_text").val("");
                \$("#feedback_ty").hide(1500);
            }
            function feedback_ty(){
                \$("#feedback_ty").fadeIn(2000);
                setTimeout(feedback_close, 5000);
            }
            function submitFeedback(){
                \$.ajax({
                    type: "GET",
                    url: "{$strURL}",
                    data: "url="+escape(document.location.href)+"&text="+escape(\$("#feedback_text").val()),
                    success: feedback_ty()
                });
            }
            //]]>
            </script>
            <div class="feedback_main"><div class="feedback_form">
            <span class="headline12">
HTML;
        echo _('Send Us Feedback');
        echo <<<HTML
\t    </span><br />
HTML;
        echo _('Let us know what you think. &nbsp; Likes, dislikes, questions, comments, bugs, or anything.');
        echo <<<HTML
            <form method="post" action="/"><textarea id="feedback_text"></textarea>
            <input type="button" value="Submit" onclick="submitFeedback();" /> or <a href="#" onclick="feedback_close();">Cancel</a>
            </form></div><div id="feedback_ty">
            <span class="headline12">
HTML;
        echo _('Thank You');
        echo <<<HTML
\t    </span><br /><br />
HTML;
        echo _('Your comments are valuable to us. &nbsp; We appreciate your taking the time to help make Ofuz even better.');
        echo <<<HTML
            </div></div>
            <input id="feedback_button" type="image" src="/images/send_feedback.jpg" />
        </div>
HTML;
    }
Ejemplo n.º 14
0
?>

		team_name = $("#team_name").val();

		if($("#auto_share").attr('checked')) {
			auto_share = 'Yes';
		} else {
			auto_share = 'No';
		}
		
		if(team_name) {
			$.ajax({
				type: "GET",
				<?php 
$e_team = new Event("Teams->eventAjaxEditTeam");
$e_team->setEventControler("ajax_evctl.php");
$e_team->setSecure(false);
?>
				url: "<?php 
echo $e_team->getUrl();
?>
",
				data: "idteam="+idteam+"&team_name="+team_name+"&auto_share="+auto_share,
				success: function(response){
					if(response == 'ok') {
						$("#divTeamMsg")[0].innerHTML = "The Team has been updated.";
						$('#DivEditTeam').hide('slow');
						$('#DivEditCW').show('slow');
					} else {
						$("#divTeamMsg")[0].innerHTML = "The Team Could not be updated. Please try again.";
					}										
Ejemplo n.º 15
0
include_once 'includes/header.inc.php';
$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);
            }
        });
    }
Ejemplo n.º 16
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");});
    });
Ejemplo n.º 17
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;
     }
 }
Ejemplo n.º 18
0
            url: "<?php 
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>
    ?>
			</a>
		</li>
	</ul>
	<?php 
}
?>
    
    <?php 
if ($module_id == 15) {
    ?>
	<ul class="nav nav-list">	
		<li>
			<?php 
    $e_inv_pdf = new Event("\\cpanel_export\\ExportInventoryData->eventInvoicePDF");
    $e_inv_pdf->setEventControler(CPANEL_EVENTCONTROLER_PATH . 'cpanel/' . "eventcontroler.php");
    $e_inv_pdf->addParam("m", $module);
    $e_inv_pdf->addParam("mid", $module_id);
    $e_inv_pdf->addParam("record_id", $sqcrm_record_id);
    ?>
			<a href="/<?php 
    echo $e_inv_pdf->getUrl();
    ?>
">
			<img src="/themes/images/pdf.png" style="vertical-align:center;">
			<?php 
    echo _('generate pdf');
    ?>
			</a>
		</li>
	</ul>
Ejemplo n.º 20
0
?>
</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>
                            <td><?php 
Ejemplo n.º 21
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');
Ejemplo n.º 22
0
    function fnViewTask(idproject_task) {
        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);
            }
        });
Ejemplo n.º 23
0
		<input type="submit" class="btn btn-primary" value="<?php 
echo _('Delete');
?>
"/>
	</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();
Ejemplo n.º 24
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;
 }
Ejemplo n.º 25
0
					$('div#last_contact_loader').empty();
			}
		});

}

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();
			}
		});

}
Ejemplo n.º 26
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>
Ejemplo n.º 27
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);
                }
Ejemplo n.º 28
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>' ;
Ejemplo n.º 29
0
            	$("#e"+task)[0].innerHTML = html;
                $("#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();
                });
            }
        });
Ejemplo n.º 30
0
        $ProjectDiscuss->sessionPersistent('ProjectDiscussCount', 'project.php', OFUZ_TTL);
        $_SESSION['ProjectDiscussCount']->prj_discussion_count = $count_discussion;
        //$_SESSION['ProjectDiscussCount']->sql_qry_start = 0;
    }
}
$DiscussNoteExpend = new ProjectDiscuss($GLOBALS['conx']);
$DiscussNoteExpend->sessionPersistent("DiscussNoteExpend", "contacts.php", OFUZ_TTL);
?>
<script type="text/javascript">
//<![CDATA[
function showFullNote(idproject_discuss){
    $.ajax({
        type: "GET",
<?php 
$e_ProjectDiscuss = new Event("DiscussNoteExpend->eventAjaxProjectTaskDiscussion");
$e_ProjectDiscuss->setEventControler("ajax_evctl.php");
$e_ProjectDiscuss->setSecure(false);
?>
        url: "<?php 
echo $e_ProjectDiscuss->getUrl();
?>
",
        data: "idnote="+idproject_discuss,
        success: function(notetext){
            $("#notepreview"+idproject_discuss)[0].innerHTML = notetext;
        }
    });
}
//]]>
</script>